269 Topics
|
|
HI All, :D I'm computer science student. Would you like to tell me about that problem? Here. 1) RE for accepts all strings of (a,b,c) that contains an odd number of a's. 2)Re for the language of all binary of strings that have at least three symbols and whose first … |
|
I need some help. I have figured out most of my script but I need to search a string and see if it starts with certain characters and Does not end in another. [$line1 = "EB*1**96" #should produce true value and blank line] [if ($line1 =~ /^EB\*/ and $line1 ne … |
|
I have a project where I'm recursing into drives specified by the user and am getting rid of any "invalid" characters defined in a RegEx pattern. I'm very new to this and C#, so any help would be appreciated! If the file contains ANY of these characters: | # { … |
|
I hope someone can help me with a simple RegEx for a preg_replace. I need to replace something like this [code]0.00|2=399.0000[/code] so I'm only left with the value '2'. Would preg_replace be the most effective method to achieve this result? Another example [code]0.00|13=69.0000[/code] to lift out value '13'. Thank you … |
|
I am planning to use preg_replace to remove some unwanted stuff from dynamic string $mystring: <ul><li><a href="http://www.url.com/wiki/How_to_fix_erection_problems_after_prostate_surgery&diff=335&oldid=prev">How to fix erection problems after prostate surgery</a></li> <li><a href="http://www.url.com/wiki/Wikipenis:Community_Portal&diff=334&oldid=prev">Wikipenis:Community Portal</a></li> </ul> This string is generated from an RSS reader. (The url has obviously been replaced to make sure no one thinks this is … |
|
Hello. I just want to know if it's possible to use regular expressions in the match attribute of the template element. For example , suppose i have the follow xml document: <greeting> <aaa>Hello</aaa> <bbb>Good</bbb> <ccc>Excellent</ccc> <dddline>Line</dddline> </greeting> Now the xslt to transform the above document: <xsl:stylesheet> <xsl:template match="/"> <xsl:apply-templates select="*"/> … |
|
Ayoo errbody, So i have an array full of strings that I need to apply some regular expressions to and then store the results in another array. What would be the best way to do this? |
|
I found this great piece of code for validating URL's. I've been trying to get it to work with preg_match() since eregi() is deprecated with with PHP 5.3: [code=php]// SCHEME $urlregex = "^(https?|ftp)://"; // USER AND PASS (optional) $urlregex .= "([a-z0-9+!*(),;?&=$_.-]+(:[a-z0-9+!*(),;?&=$_.-]+)?@)?"; // HOSTNAME OR IP $urlregex .= "[a-z0-9+$_-]+(.[a-z0-9+$_-]+)*"; // http://x … |
|
For this project i need to have the ability to analyze a file containing a number of .NET(3.5) class's from source code.. identify every class and then output each seperate class into their own text file i.e(this is what the file is like, contains a number of class's in it, … |
|
I have some random text like: [CODE]>>>text= \ """import sys n = int(sys.argv[1]) ;;print "blbalbalbalabllalbaa" replace me i in range(1,n) {print "numbers:";;replace me j in range(1,3) {print j} ;;print i ;;replace me k in range(1,3) {print k} ;;print "end!"} replace me n < 5 {print n ;;print "youragenious"} """[/CODE] i'd … |
|
Okay, so I'm having problems with my code. I've browsed Daniweb and couldn't find any solutions on here that work. I'm extracting 2 sets of texts from a .xml file. The first part is a directory name(eg. "C:\work\") and the second part is the name of a file in that … |
|
[CODE] private Map<String , String> c = new HashMap<String , String>(); .... //regx to get mString c.put(mString.group() , mString.group()); ..... //regx to get mNumber c.put(mNumber.group() , mNumber.group()); ....... Set set = c.entrySet(); Iterator i = set.iterator(); while( i.hasNext() ) { Map.Entry me = (Map.Entry) i.next(); System.out.println(me.getKey() + " : " … |
|
Hi. I am trying to match a string: "RemoveAcc $k: $v" There are an arbitrary number of spaces between RemoveAcc and the two variables...Preferably I would like to store these to variables using $1 and $2 after the string is parsed, but I do not want to save the RemoveAcc … |
|
Hello! =) Please help me with this! =) This is my last one to my diploma work! =) If the user enters a number in the textfield, than JS should set the selection in the textarea to that line. Empty lines are changed to " \n" coz I like for-in … |
|
Hi Guys, I'm in need of regular expression for validating the html tags that are closed properly, say for example <i>test content <b>see this </i> .. it should show an alert "tag is incorrect". Plz help me....Guys-:)-:) Thanks in advance |
|
Hi all, I don't know whether my question belong here but any ways why every browser has a built-in regex engine? Why they have to find patterns in a http page? |
|
I trying to get text only from html code (no tags and exec) I used the next command (regular expression): htmlSurce = htmlSurce.replaceAll("\\<.*?*\\>", ""); it works fine but all the text between <!-- --> is not removed how can I remove it??? |
|
|
Hi folks, I'm looking for a function, similar to str_replace that replaces just the first occurance of a specified string. I have found such a function: [url]http://www.help2go.com/Tutorials/Programming/PHP_:_How_to_replace_only_the_first_occurrence_in_a_string_with_str_replace.html[/url] However, this does not take into consideration of 'search from an initial position'. My interest is with regard to replacing strings within a … |
Hey guys, so i've posted here before about regex, and i was told that some of you may be able to check my regexes for errors after i have created them. I have one that looks like it should work to me, but it absolutely will not. [code] public static … |
|
Hi, my problem is in regular expression. I need to catch from html code hyperlink tag's href atribute content if this hyperlink contains search condition. here is snippet: [CODE=php]$a = "nail"; //search ctriteria between <a></a> $s =<<<EOF <a class="level2" onmouseout="this.style.background = '';" onmouseover="this.style.background ='#2c7cf4';" href="index.php?item&module=1&category=11" style=""> kaut kas cits </a> … |
|
I am having some problems with my java code, i am trying to write a C compiler and am currently working on developing a string tokenizer for the C programming language using java regex. my problem is first my program wont recognize multiline comments and second i cant figure out … |
|
Hello all. I have a small problem, the next code finds the neden content, but it doenst print it: [CODE]$string = "#324423asdd asd 'BecamePosters' "; if($string =~ m/'[a-zA-Z]{1,40}'/) { print "ok!\n"; print $1; } else { print "not ok!\n"; }[/CODE] It only prints "ok!\n" but nothing more. Also triyed m/'*'/ … |
|
Hi, I have the following regex pattern. I don't think there is anything wrong with it. It seems to work when i test but if someone sees anything wrong with it please feel free to tell me. I don't know Regex but managed to put a username validator together as … |
|
Hi all I've been trying to find a regular expression that checks if input contains any of the following characters only: `~!@#$%^&*()-=+\|/?.>,<;:'"[{]} I want to allow users to input any normal character a-z or any numbers as well as underscores and any special character that resembles a letter such as … |
|
Hi I receive ascii data from the serial port which consists of only 0 to 9, /005, /004 and spaces between values, but sometimes the harware get spikes from the electric motors and then the recorder add some funny characters. I need to check the string PortData = "" to … |
|
Hi guys!! I've to make a program that reads an arithmetical sentence from a textbox, e.g 12.3*34+4*5-3 and then on another textbox identify and display what is the content of the first textbox, for example taking the last ex: If I have this input: 12.3*34+4*5-3 The output should look like … |
|
Hi, I have the following string in a XML file.. [CODE]<pre></BODY></HTML> ------_=_NextPart_002_01C84D7E.9133E008-- Content-Disposition: attachment; filename="footer.txt" Content-Transfer-Encoding: base64 G:\Test\Attach\footer.txt --------------Boundary-00=_BLD1cvEPKmuNkgPvUNY3-- Content-Disposition: attachment; filename="Press.xls" Content-Transfer-Encoding: base64 g:\Test\Attach\Debankan\Press.xls ------_=_NextPart_001_01C84D7E.9133E008-- </pre>[/CODE] I will pass the filename and i want to get the path from the above string.. [B]For ex.. if i pass "footer.txt" i … |
|
guys i need an error-free way of keeping name value pairs in a regular c# string. i am quite busy, i dont think i am able to come up with the best algorithm now. what i want is two methods one to add a name-value pair to the string, the … |
|
Hi mate, I use regex for my validation but @ this time I get confuse, how to use white space in it. I want user to enter a city name, some city name contains white space like Los Angeles, New York, I have regex which is not allowing user to … |
The End.