Also available in Python's re module, with a syntax that's just different enough to be irritatingly incompatible.
>>> import re
>>> r = re.compile(r'(?P<month>\d{1,2})\/(?P<day>\d{1,2})\/(?P<year>\d{4})')
>>> r.search("Today's date is: 10/23/2012.").groupdict()
{'month': '10', 'day': '23', 'year': '2012'}
I wish I had enough karma to downvote this useless comment. At least have the decency to tell us why you think this is so awful. I for one love seeing things like this on HN. One of my favorite things about this site is it's not just news. On any given day, I might find a new tool, language, function, or just another way of looking at things that I hadn't considered before. This is why hacker news is awesome. You're why it's terrible.
Some people think HN is a startup aggregator, and the actual tech and toolkit and non-startup news is unimportant.
There was a post some time ago and one comment went into some detail about HN's overall demographic and how the segments of that aren't entirely compatible (well, if you removed the personal opinion from it, anyway).
Being able to permalink (which Rubular also does) to examples is a killer feature..I keep trying to convince non-programmers who work with data that they should at least learn regexes to make their life easier
Rubular is great. The only thing preventing it from being a 'one stop shop' for learning regular expressions is that it omits describing in the notes below some functionality (eg. the "?<"..">" shown in the example). http://rubyxp.com/ is better for these descriptions.
I am new to programming and chose Ruby. I have found Rubular to be a fantastic way to learn about regular expressions through trial and error. This site has really helped me understand regex's. I was having a little trouble fully grasping the concept from simply reading books.
40 comments
[ 2.7 ms ] story [ 81.0 ms ] thread- Learn how a regex editor is built.
- Use a different regex engine (is that possible to swap)? [1]
I'm sure there are more reasons.
1 http://en.wikipedia.org/wiki/Comparison_of_regular_expressio...
Oniguruma (regex engine in ruby1.9) existed as an external library in the past (1.8) and you can get stuff like re2 for ruby this days[1]
[1] https://github.com/mudge/re2
For Python users, there is: http://www.regexplanet.com/advanced/python/index.html
Example: http://fiddle.re/22e5
Karma: 11 / 663 days old
http://news.ycombinator.com/user?id=rross0227
Adding more quality submissions or comments wouldn't have prevented this submission from being upvoted.
There was a post some time ago and one comment went into some detail about HN's overall demographic and how the segments of that aren't entirely compatible (well, if you removed the personal opinion from it, anyway).
Which I think is Flash/Flash Air...
Being able to permalink (which Rubular also does) to examples is a killer feature..I keep trying to convince non-programmers who work with data that they should at least learn regexes to make their life easier
Ruby uses Oniguruma http://www.geocities.jp/kosako3/oniguruma/
While the average regex will probably work on both, you should know there isn't a 1:1 correlation between the two.