306 Topics

Member Avatar for
Member Avatar for farhan386

I have a string contains sequences of 0 and 1. I need to replace all zero sequences whose length less than 5, into number 1 with same length. The zero sequences with length 5 or more should be left as is. For example source : 11000001100010011000001 result : 11000001111111111000001 [CODE] …

Member Avatar for farhan386
0
172
Member Avatar for koveras vehcna

Hello everyone, I am currently working on text processing with Python and I want to parse a .txt file into its sentences as a whole. I tried to create some regular expressions but I failed to do so. I only managed to come up with a regex that splits each …

Member Avatar for TrustyTony
0
1K
Member Avatar for ajithperuva

Hi, I need to retrieve anchor tag innerHTML using RegExp in php. Consider I have a syntax like [CODE] <div class="detailsGray"> <span class="detailEmail"> <a href="http://example.com"class="fontLink">examples@mail.com</a></span> </div> [/CODE] here how can we retrieve [email]examples@mail.com[/email] using RegExp and preg_match_all(). Thanks

Member Avatar for martin5211
0
87
Member Avatar for AuburnMathTutor

I have noticed a few questions popping up from time to time on the subject of formal languages in general, and on regular languages in particular. As I'm pretty bored and enjoy the study of formal languages to a reasonable extent, I thought I might try to give a quick-and-dirty …

Member Avatar for AuburnMathTutor
-1
183
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
185
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
93
Member Avatar for phphit

Ok. I have ZERO PHP Knowledge, still good in editing php and all that stuff. Only know copy paste and have no knowledge what that means. Still would try to explain my problem. I use variable to fetch data from mysql. Ex. my url is [url]http://www.example.com/venue.php?vcity=New[/url] York. Now, I want …

Member Avatar for phphit
0
319
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
164
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
104
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
152
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
174
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
166
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
119
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 sallecpt

hey all. I am trying to do validation via PHP for submitted forms. Below is my own code, please comment if its the correct method or not. However, I tried so many ways to have the /n or /r added, but I cant get to it. Its just to make …

Member Avatar for sallecpt
0
208
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
175
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
180
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
264
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 Frankey

Hi there, I am building a blog at the moment i have a amazing script that search a post for the images in it. So i can just setup a post template, call the images that are in the post and go. In this way i put the images unedited …

Member Avatar for Frankey
0
192
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
208
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
111
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
198
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
99
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

The End.