Sponsored by HowLifeWorks
How Private Online Shopping Clubs Work view!
howlifeworks.com - How to become a member and get discounts of up to 80% on must-have luxury goods
37 Comments
- opera, on 10/12/2007, -4/+17People seem to have major problems with regex. I just don't get what's so difficult.
But please, can this list just stop growing!
http://digg.com/programming/Convenient_RegEx_Building_Tool_-_Windows_Freeware
http://digg.com/programming/Input_Validation_Using_Regular_Expressions
http://digg.com/programming/Java:_Regular_Expressions
http://digg.com/programming/Regular_Expressions_In_10_Steps:_Part_2
http://digg.com/programming/Regular_Expressions_In_10_Steps:_Part_1
http://digg.com/programming/Interactive_Regular_Expressions
http://digg.com/programming/Using_Regular_Expressions
http://digg.com/programming/BunnyRegex:_Easy_Regular_Expressions_in_PHP
http://digg.com/software/RegexPlor:_an_OS_X_tool_for_interactively_exploring_regex
http://digg.com/programming/Best_Regular_Expressions_site_ever_
http://digg.com/programming/http:_sitescooper.org_tao_regexps.html
http://digg.com/programming/Basic_PHP_Page_Crawler_using_File_System_Functions_and_Regexps_
http://digg.com/programming/Using_Regular_Expressions_in_PostgreSQL
http://digg.com/linux_unix/Learn_how_to_use_regular_expressions_the_easy_way
http://digg.com/programming/Vim_Regular_Expressions_101
http://digg.com/programming/Lexing_Your_Data:_When_regular_expressions_aren_t_enough
http://digg.com/programming/Regular_Expression_Tutorial_
http://digg.com/programming/5_Regular_Expression_Tutorials_for_PHP
http://digg.com/programming/Learning_to_Use_Regular_Expressions
http://digg.com/programming/Regular_Expressions_for_client-side_JavaScript
http://digg.com/programming/ASP.NET_2.0:_URL_Mapping_with_RegEx_Support
http://digg.com/programming/lookaround_s_in_regular_expressions
http://digg.com/technology/Mod_Rewrite_and_Regular_Expressions
http://digg.com/programming/Online_Regular_Expression_Tester
http://digg.com/programming/Regular_Expression_Library
http://digg.com/links/Regular_Expressions_Reference_Sheet
http://digg.com/programming/Quoted_Strings_with_Regular_Expressions
http://digg.com/software/The_Premier_Site_about_Regular_Expressions - chrisr0, on 10/12/2007, -3/+13Re: (^(.*)Regular(.*)Expressions(.*)$ || ^(.*)regex(.*)$) = tons of articles.
You should probably read some of those articles. You're using ^ to specify the beginning of the line, but a .* right after it. The same goes for the $ at the end of the line. The .* is negating any efffect the ^ and $ are having on the pattern. Additionally, you are using using () around the .* to create capture groups, why are you interested in capturing whatever random text is there? Those paranthesis are unecessary. The "OR" operator in Regex is |, not ||. - lord2800, on 10/12/2007, -1/+10The best site I've ever found for regular expressions is http://www.regular-expressions.info.
- dime, on 10/12/2007, -3/+10The children, you insensitive clod.
Won't someone think of the children? - Tux42, on 10/12/2007, -0/+5Re: Re: (^(.*)Regular(.*)Expressions(.*)$ || ^(.*)regex(.*)$) = tons of articles.
I would add that the (.*) between Regular and Expressions can add unwanted matches.
Here is an example. I believe the following line would match but has nothing to do with Regular Expressions.
Regular payments for loans help a person's credit score. Expressions to caluclate... - headzoo, on 10/12/2007, -0/+5Yep, that is a good site. I also like http://regexlib.com for finding regexps that other people have already created. Why reinvent the wheel right?
- bpapa, on 10/12/2007, -0/+4God forbid that a lot of people post articles dealing with a fundamental part of Computer Science on Digg. Instead, we need more articles about how evil the RIAA is.
- merreborn, on 10/12/2007, -2/+6"Some people, when faced with a problem, think, 'Oh, I'll use regular expressions!'. Now they have two problems."
- lollerskates, on 10/12/2007, -0/+4I think I have to say, Ryebrye just got owned.
Personally, my regexes are not up to par, but you guys certainly have it. - merreborn, on 10/12/2007, -0/+4"I wouldn't hire someone that doesn't know at least the basics of regexp, no matter how good their other skills are."
Bah, any good programmer can pick up a new syntax in no time. Any good hiring manager knows that. - jesusphreak, on 10/12/2007, -8/+12Regexs are amazing and they really aren't that complicated - on first glance their syntax just scares people.
They are available in Perl, Ruby, PHP, Python, C#...really any modern programming language has them available. I use them in Ruby on Rails to validate different fields. For example, I can check a piece of input (such as an e-mail address) to make sure its valid.
They are a very powerful and useful too. - OBKenobi, on 10/12/2007, -0/+3( o )( o )( )i( )
- persaltier, on 10/12/2007, -1/+4and yet, they continue to all get hundreds of diggs and front page time, so obviously someone out there finds these useful.
- lollerskates, on 10/12/2007, -0/+3Man, that thing forgot to cover greediness. Or is that just in Perl?
- lollerskates, on 10/12/2007, -0/+3Don't forget grep, awk, and sed.
- davdav, on 10/12/2007, -2/+5I, for one, have not yet taken the time to learn regex. I keep digging as a reminder.
Sigh - yahoofrom, on 10/12/2007, -0/+2Regexs are not so complicated as you think.
regex is easier to understand than Lebesgue measure theory. - headzoo, on 10/12/2007, -1/+3@captaindan - Perhaps you missed the "bookmarking" part of Digg's `about digg` page.
@davdav - Get on it! Regexp open up a whole new, complicated world to programming. I wouldn't hire someone that doesn't know at least the basics of regexp, no matter how good their other skills are. - barthosch, on 10/12/2007, -3/+4if (guide.length > fit_on_one_page) ignore();
- nurriz, on 10/12/2007, -5/+6It sucks, but still you're here to reply. Who did this hurt?
- seannicholls, on 10/12/2007, -0/+1Regex may not be complicated but its arcane, innane, obfuscating, and absolutely totally confusing.
took me a week to work out what the hell was going on, even then I still have great difficulty remembering it, not that I use it often. but still. - dime, on 10/12/2007, -5/+6Up next:
DHTML: That spooky D, explained! - dime, on 10/12/2007, -2/+3I think it's fairly obvious half the people here don't actually digg because it's good but rather because it's there.
It's always great when a site croaks 10 minutes after the post, no cache, and yet hundreds of diggs appear magically. - captaindan, on 10/12/2007, -2/+3It's probably more appropriate to use your browser's bookmarks for that.
- voltagex, on 10/12/2007, -1/+2If you've ever actually used regex, you'll know you can never have too many resources on it.
- inactive, on 10/12/2007, -1/+2DHTML = Dave Hypertext Markup Language.
there you go. - mordain, on 10/12/2007, -0/+1yeah, i made a complete bot uing them. now i dont play at all, just get my bot to xp me up then go out and hunt players down like the botless dogs they are. :-)
- leeuk, on 10/12/2007, -0/+1If you don't know about The Regulator - http://regex.osherove.com/ - check it out, it's a great free regex editor for windows. - Not spam, I have nothing to do with it apart from use it.
- Haplo, on 10/12/2007, -1/+2No, most regexp implementations are greedy, Perl is a language that also has non-greedy regexps. You can overcome greediness by negation like:
"([^"]*)" - matches a ", zero or more non-" and a closing ", so matches "hello" but not "hello"hello".
In perl you could write that as:
"(.*?)" - beoswulf, on 10/12/2007, -0/+1This is awsome. Regular expressions are great for Mudders with a good Mud client that can handle them.
You can automate so many commands on the fly. - funked, on 10/12/2007, -1/+1I had no idea Regular Expressions were so exciting.
- RyeBrye, on 10/12/2007, -7/+4(^(.*)Regular(.*)Expressions(.*)$ || ^(.*)regex(.*)$) = tons of articles.
Thanks for pointing out how lame anyone who diggs this article is. It's the "UltiDupe!"
No digg for excessive duping. Anyone interseted in regex shoud/could find it themselves with minimal effort. - jesusphreak, on 10/12/2007, -10/+6Its not a dupe if its not even the same website...
- Haplo, on 10/12/2007, -6/+2"they really aren't that complicated" - meaning that you either are a genius or have never used real world regexps.
- zeeneo, on 10/12/2007, -9/+4not a dupe but anyone can google this stuff. if you dont know how to use regular expressions then use google to find your help.
*boring* --digg - opera, on 10/12/2007, -17/+8Yahoo for dupes... digg sucks so much it hurts.
http://digg.com/programming/Best_Regular_Expressions_site_ever_
http://digg.com/programming/Learning_to_Use_Regular_Expressions
http://digg.com/programming/Regular_Expression_Library
http://digg.com/programming/Quoted_Strings_with_Regular_Expressions - opera, on 10/12/2007, -13/+3It's a dupe because it's nothing to demystify. There is no mystery. People who don't know regex have had their chanses before on digg, no need for more of it.
That's all I meant. There are good things to post, interesting things. And there is junk like this.


What is Digg?