269 Topics

Member Avatar for
Member Avatar for zombiegirl

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 …

Member Avatar for zombiegirl
0
184
Member Avatar for mroberts

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 …

Member Avatar for d5e5
0
90
Member Avatar for newbie_coder

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: | # { …

Member Avatar for newbie_coder
0
163
Member Avatar for Witblitz

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 …

Member Avatar for Witblitz
0
103
Member Avatar for SerjSagan

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&amp;diff=335&amp;oldid=prev">How to fix erection problems after prostate surgery</a></li> <li><a href="http://www.url.com/wiki/Wikipenis:Community_Portal&amp;diff=334&amp;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 …

Member Avatar for SerjSagan
0
151
Member Avatar for Pedro Costa

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="*"/> …

Member Avatar for iceandrews
0
171
Member Avatar for Code_GrasssHopp

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?

Member Avatar for andrewll2
0
72
Member Avatar for bigtalk

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 …

Member Avatar for bigtalk
0
164
Member Avatar for Code_GrasssHopp

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, …

0
108
Member Avatar for mesuge6666

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 …

Member Avatar for griswolf
0
118
Member Avatar for P00dle

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 …

Member Avatar for P00dle
0
4K
Member Avatar for white feather

[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() + " : " …

Member Avatar for white feather
0
174
Member Avatar for samready

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 …

Member Avatar for d5e5
0
178
Member Avatar for benqus

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 …

0
86
Member Avatar for mohanrajit.88

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

Member Avatar for fxm
0
250
Member Avatar for aquaticdeity

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?

Member Avatar for cwarn23
0
43
Member Avatar for stewie griffin

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???

Member Avatar for stewie griffin
0
207
Member Avatar for diafol

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 …

Member Avatar for diafol
0
173
Member Avatar for tjsail

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 …

Member Avatar for ~s.o.s~
0
109
Member Avatar for Slammer

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&amp;module=1&amp;category=11" style=""> kaut kas cits </a> …

Member Avatar for Slammer
0
125
Member Avatar for bloodreign39

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 …

Member Avatar for musthafa.aj
0
193
Member Avatar for jen140

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/'*'/ …

Member Avatar for jen140
0
98
Member Avatar for genieuk

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 …

Member Avatar for Kruptein
0
106
Member Avatar for Venom Rush

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 …

Member Avatar for Venom Rush
0
5K
Member Avatar for procomp65

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 …

Member Avatar for Geekitygeek
0
2K
Member Avatar for doomfrawen

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 …

Member Avatar for doomfrawen
0
205
Member Avatar for rajaseeth

Hi, I have the following string in a XML file.. [CODE]<pre>&lt;/BODY&gt;&lt;/HTML&gt; ------_=_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 …

Member Avatar for ddanbe
0
145
Member Avatar for serkan sendur

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 …

Member Avatar for kvprajapati
1
1K
Member Avatar for Jeyush

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 …

Member Avatar for digital-ether
0
155

The End.