55 Comments
- burstlag, on 10/12/2007, -0/+7The front page says that the regex "b[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z]{2,4}b" (hope that pastes properly) will match any valid email address. This is incorrect and I hope nobody actually decides to cut and paste it into their code because it would fail to match many perfectly valid email addresses. Two that I can think of immediately are user@foo.co.uk and user+foo@gmail.com. Not to mention the fact that most regex engines take case into consideration, thus the supplied expression would only match fully uppercase addresses for them.
Regexs are a bit of an art because you have to be creative enough to imagine all possible permutations of whatever you're trying to validate. Much trickier than it sounds, believe me. - Lazaryn, on 10/12/2007, -0/+2Yes, that E-mail validator regular expression would not match
"Joe (Monkey) Bloggs"@[123.234.210.12]
even if it is a valid E-mail address according to the RFC-822. - inactive, on 10/12/2007, -0/+1I used it a few times in the past, but I find the layout of the site somehow bothersome. I'm not entirely sure why - I just do. I prefer to just go grab my O'Reilly regexp book. Still, it's not a bad starting point. Hopefully they have more content than the last time I was there. :)
- gabbagabbahey, on 10/12/2007, -0/+1http://www.weitz.de/regex-coach/ - free regex evaluator
- reidypeidy, on 10/12/2007, -0/+1@ tornamodo
It lags because there is a non scrolling background image. Gecko (firefox's rendering engine) has some trouble rendering those without any lag. - Njall, on 10/12/2007, -0/+1NO DIGG! This is a shill post for a commercial piece of software. While the tutorial is interesting everything else, including "get a printable PDF of the tutorial" requires the reader to plop down $30 for a piece of code they'll be likely to use 6 times. The poster states "A whole site just about regex!" That's a lie. It's a whole site, along the lines of TV info-mercials, with one and ONLY ONE purpose. To get you to part with your $30. But wait! You don't just get the...
I'd give this a negative DIGG if I could. - inkswamp, on 10/12/2007, -0/+1I'm surprised at how many programmers I meet who don't understand regular expressions or only vaguely understand them. My employer flew me to a three-day training session in DC last year. Some of the material being covered involved regular expressions. The instructor asked everyone in the room (all programmers) who understood regular expressions and I was the only one who raised my hand. I was as shocked as the instructor was.
Regular expressions are simple, powerful and indispensable once you know how to use them. I would advise anyone unfamiliar with them to study the stuff on this site and master the use of what's there. You will not regret it. - Beautyon, on 10/12/2007, -0/+1RegexPlor is a visual regular expression evaluator for OSX:
http://python.net/~gherman/RegexPlor.html - MarkJaquith, on 10/12/2007, -0/+0This site singlehandedly taught me regex about two years ago. I still go back whenever I'm feeling rusty!
- Callisto, on 10/12/2007, -0/+0Good guide, dugg.
- spling, on 10/12/2007, -0/+0This site is a great resource. Helped me alot when I was first learning regex. Digg++
- jbno, on 10/12/2007, -0/+0Ugh. Digg.com ate the backslashes and offers no preview, so there was no way for me to know that the regular expressions would be wrong.
Using slashes instead of backslashes, just to overcome digg.com's silliness, the first sentence should read:
The equivalent of "*.txt" is "/.txt", not ".*/.txt" as the site claims. - jbno, on 10/12/2007, -0/+0filcab: no, I didn't. You don't need one. In this example, the only anchor that matters is at the end of the string. There's no need to specify the "^" unless you want to target the beginning of the string, which we don't.
For clarity: "*.txt" is closer to "/.txt$" than it is to what the website says (again, using the wrong slashes because of digg.com's filter which is both underdocumented and inappropriate for discussions like this).
\ \ - Dracos, on 10/12/2007, -0/+0This site is written by the author of EditPad Pro, the best text editor for Windows, *bar none*. EditPad Pro is one of only two shareware programs I've ever bought.
He does have a Linux port, but it's built against Qt, and runs painfully slow under Gnome. - detrate, on 10/12/2007, -0/+0Wow... the first page that comes up when you google 'regular expressions'.... Thanks for pointing this page out, I would have never found it... except for the fact I already did... and thought it was crap. There are errors all over the place.
- levee, on 10/12/2007, -0/+0It's not like this is a new site - it's been up for ages. Having said that, an indispensible resource so +digg
- Stri, on 10/12/2007, -0/+0AIIIIIIIIEEEEEEEEEEEEEE my brain is mellllltiiiiiiiiiiiiing!
- traherom, on 10/12/2007, -0/+0@burstlag
It would match the first one... granted, the second one would fail, but all you have to do is add the + to the first character class. - FilCab, on 10/12/2007, -0/+0@fisherman: It's due to their background in math... You'd have to study some history :P Jeffrey Friedl explains it in his (very good) book (http://regex.info/ )
This site is not that good... When I searched for some info I wanted about regex, I couldn't find it in this site. Their regex for e-mails isn't good... It matches any TLD with 2-4 letters... there are TLDs with more than 4 letters (museum) and, for example, there is no TLD fjk...
As of July 2002 you had these TLDs (it's trivial to craft a regex that matches only these TLDS):
com, edu, gov, int, mil, net, org, biz, info, name, museum, coop, aero, and any 2 letter country code. - cabazorro, on 10/12/2007, -0/+0Every contrived and non-human readable regular expression has some english sentence counterpart:
/ +/ : match one space or more.
How about a web page where you type the english sentence and spits out a regular expression?
That is why we created computers...you know... hint hint. - veracon, on 10/12/2007, -0/+0Good site, but not news. Reported.
- dasch, on 10/12/2007, -0/+0@traherom: it also fails to match addresses with non-ascii letters in them, e.g. john.doe@øllegrød.dk
- casiotone, on 10/12/2007, -0/+0"How about a web page where you type the english sentence and spits out a regular expression?
That is why we created computers...you know... hint hint."
because "match one or more a to z or 0-9 or . or _ or % or - then @ then one or more a to z or 0-9 or . or - then . then two to four a to z" is hard to read. - AKX1, on 10/12/2007, -0/+0It's a fairly good site, but it's old as.. some old thing.
- jtms1200, on 10/12/2007, -0/+0very useful site for the developers out there.
- tarun, on 10/12/2007, -0/+0I went to this site the other day thru a strange Trip through the Internet:
I typed "regular expressions" in google
http://www.google.com/search?sourceid=navclient-ff&ie=UTF-8&rls=GGGL,GGGL:2005-09,GGGL:en&q=regular+expressions - CaughtThinking, on 10/12/2007, -0/+0people shouldn't be so intimidated by regular expressions. the best way to learn them is to simply use em. and remember, some things are better solved by some simple ifs. ESPECIALLY THE EMAIL VALIDATOR.
- keej, on 10/12/2007, -0/+0Used this site recently to help me learn regex, very handy.
- jk3us, on 10/12/2007, -0/+0When I saw the headline I thought "Good! The only decent one I've seen is that orange site, but it kinda sucks".... then I discovered this IS that orange site :( no digg.
- puleen, on 10/12/2007, -0/+0
I prefer this one myself, http://regexlib.com/default.aspx - puleen, on 10/12/2007, -0/+0
You just found this site, this site has been around for ages.....Cheers anyways :) - ealfert, on 10/12/2007, -0/+0Thank you gabbagabahey for that great link. I didn't know about such programs. That will make my life easiers.
Thank you puleen for the link to that database that will serve as a cheat-cheat of sorts. - patto, on 10/12/2007, -0/+0a site built around them selling 2 bits of software
no thanks...
any good sites out there without an agenda? - bayonne, on 10/12/2007, -0/+0very good site. scary that someone has done a whole site for regex. wow. wow.
i now its commercial but the site is still good nd info enuf for a dig. - josuemedia, on 10/12/2007, -0/+0Damn i guess someone here hasn't read up on previous stories digged about this site!?!?!?! This has been digged so many times that i lost count, people should start using "digg search" before submitting a story.
Puleen, i believe you are one of a few people on digg whom has suggested http://regexlib.com ! its a kick ass website. - TailGater, on 10/12/2007, -0/+0My fav RE tool :
Expresso - A Tool for Building and Testing Regular Expressions -- http://www.codeproject.com/dotnet/expresso.asp
Cant live without it! - dwalker, on 10/12/2007, -0/+0This is total tosh...
Just an advert for the sofware they are selling as "Njall" above has pointed out!
There is very little real info there, just the basics and links to BUY their software.
A POOR digg.... - FilCab, on 10/12/2007, -0/+0^^ (gabbagabbahev)
"Made with lisp" - jbno, on 10/12/2007, -0/+0The site should offer a better regular expression example on its front page: the equivalent of "*.txt" is ".txt$", not ".*.txt" as the site claims. The wildmat is implicltly anchored at the end of the file name (all you need to specify is where other characters may go) but regular expressions are not implicitly anchored at either end of the string (all you need to specify is what can match).
".*.txt" matches ".txt" anywhere in the string. The leading ".*" is just a time-waster that will make matching needlessly slow by forcing the literal dot and the "txt" that follows to be backtracked out of the greedy match-everything ".*" expression. You want to avoid backtracking if you can, and in the example presented by the webpage, you can.
A far better tutorial on regular expressions is Jeffrey E. F. Friedl's book "Mastering Regular Expressions" published by O'Reilly. Ask for it at your public library (ISBN 0-596-00289-0) and visit http://regex.info/ for more about the book. - jaredvolkl, on 10/12/2007, -0/+0Found a site that has an extremely long RegExp for validating an email address, but it claims to cover RFC822 which outlines email addresses.
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html - valrus, on 10/12/2007, -0/+0Agree with Niall. The site is a shill for EditPad Pro and doesn't contain that much useful information. Lame.
How about this: http://sitescooper.org/tao_regexps.html - Thurloat, on 10/12/2007, -0/+0nice!! i've been lookin for a site like this for a whlie :) now i don't have to write them out :P
- ileadyouth, on 10/12/2007, -0/+0This site is GREAT. I used it a while back when I was learning Regular Expressions. Also, the book Mastering Regular Expressions by Jeffrey Friedl is excellent. This site gives some good basic insight, but the book really dives deep and is incredible.
I agree with some others, it is not that hard once you get into it and USE them on a daily basis. They are powerful when used RIGHT - and it does take some reading to understand what the BEST way is to use them (for performance reasons).
Definite digg.... - Junto, on 10/12/2007, -0/+0Much better is www.regexlib.com. The cheat sheet and online tester are really useful, plus you have more user submitted regular expressions than I have seen anywhere else.
- spiderfish, on 10/12/2007, -0/+0If you want to try out Perl-compatible regexps I suggest you download Regexp Coach - http://www.weitz.de/regex-coach/ - it's free btw.
- taswake, on 10/12/2007, -0/+0I have to agree with Njall and would negative digg this if I could
- FilCab, on 10/12/2007, -0/+0@jbno: you forgot the ^ ate the beginning of the regex :P
BTW... J. Friedl's book is very good :D - tornamodo, on 10/12/2007, -1/+0i have a strange delay on this page when scrolling up and down with firefox
- Nycto, on 10/12/2007, -1/+0waaaay ofn
- dumbtech, on 10/12/2007, -1/+0Good site, but this isn't news.
-
Show 51 - 54 of 54 discussions



What is Digg?
Digg is coming to a city (and computer) near you! Check out all the details on our