Re:Debuggex: A visual regex debugger
by kgen on Friday February 22, 2013 @03:03PM
(#5266423)
I once wrote a website (http://regexone.com) to help people learn regular expressions using practical examples -- maybe you would like to give that a try and see if it helps you in understanding the different regexes a bit more?
[ Parent
| on HN ]
Re:Debuggex: A visual regex debugger
by zaptheimpaler on Friday February 22, 2013 @11:05PM
(#5268505)
I just went through all the examples, that was awesome! Best tutorial I've seen yet. With this and debuggex, I should be all set to parse HTML with regexes (kidding).
By the way, could someone explain this to me - do regexes match a string if a part of a string matches the regex, or if the whole string does?
For example, this regex "([+|-]* )(\d+[,|.]* )(\d+)(\.)?(e)?(\d+)" (intended to match decimal/scientific numbers - see http://regexone.com/example/0) matches "720p" on regexone, but fails to match on debuggex. So it seems like it varies depending on some configuration - is that right?
Re:Debuggex: A visual regex debugger
by archangel_one on Saturday February 23, 2013 @03:56AM
(#5269051)
That regex doesn't match 720p on regexone (and shouldn't - it has required spaces in it). You're getting a tick for the bottom item because it's not supposed to match that case.
As for your question, it generally depends how they're called - eg. in Python's re module, whether you call search() or match(). You can force a regex to match the entire string by adding ^ and $.
Re:Debuggex: A visual regex debugger
by dancesdrunk on Friday February 22, 2013 @07:19PM
(#5267845)
Used your site a few months ago and have been recommending it to everyone since! Can I make a request for "best Solutions" & possibly more exercises? Its been the best resource I've found for getting the basics down, thanks!
Re:Debuggex: A visual regex debugger
by UnoriginalGuy on Friday February 22, 2013 @05:34PM
(#5267341)
Holy shit, that is amazing. I'm currently working my way through it. I feel more confident already.
Seriously thank you.
Thanks for the link, this looks very helpful!
Just two comments:
* when having cases that should match and other that not, It would be ok to differentiate them
* in some lessons it would be ok to force the full string to be matched. If not it's too easy to write i.e. file in http://regexone.com/lesson/8? and pass to the next one.
I was just taking a look to it as I'd like some of my non-technical staff to understand how regex works - they need it for Google Analytics filters - and it looks wonderful.