5 ms·
Rubular - a Ruby regular expression editor
- skram 14y ago+1 - I love Rubular and use it whenever I have to write regular expressions for fun or profit.
- mrchess 14y agoHow does one write regular expressions for profit? Do you mean using regex's to filter datasets or do you actually sell regex's?
- Falling3 14y agoI've been using Rubular for years and it's really a great tool for trying to quickly figure out where you went wrong in a complicated regex.
- ghayes 14y ago+1, it's really been a godsend for me
- brettbender 14y agoLove rubular, use it every single time I write or edit a regex, just to test some weird cases while I think through the syntax.
- blaines 14y agoI love rubular too. Question though... Why isn't it open source?
- mhartl 14y agoWhat would be gained if it were? I suppose you could run it locally. Come to think of it, that would be nice.
- blaines 14y ago- Yes, run it locally. (Sometimes I want to test against sensitive information) - 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_expression_engines http://en.wikipedia.org/wiki/Comparison_of_regular_expressio...
- riffraff 14y agoas for [1] yes, you're just unable to use ruby's syntax. 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 https://github.com/mudge/re2
- logn 14y agoIt's not much more than a webapp wrapper around Ruby's built-in regex functionality.
- mhartl 14y agoRubular is one of my favorite examples of a perfectly designed site. It has everything you need and nothing you don't.
- smackjer 14y agoTotally agree. It inspired me to build http://strfti.me http://strfti.me, and eventually the stamp gem.
- lolwutreddit 14y agoI can thank Michael Hartl for showing me this gem in the Rails tutorial.
- amorphid 14y agoI've been using this since '09. I love it!
- adovenmuehle 14y agoI use this quite a bit. Also displays named captures with values which is nice.
- cynwoody 14y agoThat's very nice. For Python users, there is: http://www.regexplanet.com/advanced/python/index.html http://www.regexplanet.com/advanced/python/index.html Example: http://fiddle.re/22e5 http://fiddle.re/22e5
- TheSmoke 14y agofor python i use http://re-try.appspot.com http://re-try.appspot.com
- logical42 14y agoi didn't realize that it was possible to name a capturing group. this is an awesome example.
- aaronblohowiak 14y agoruby > 1.9
- pjscott 14y agoAlso 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'}
- boneheadmed 14y agoDidn't know about this. Love it! Thanks for sharing.
- rross0227 14y agoAnd this is why hacker news is terrible.
- blaines 14y agoYou aren't making it better. Karma: 11 / 663 days old http://news.ycombinator.com/user?id=rross0227 http://news.ycombinator.com/user?id=rross0227
- xyzzyb 14y agoWhat does that have to do with it? Adding more quality submissions or comments wouldn't have prevented this submission from being upvoted.
- Falling3 14y agoI 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.
- FuzzyDunlop 14y agoSome 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).
- deleted 14y ago[deleted]
- danso 14y agoI also like using http://www.gskinner.com/RegExr/ http://www.gskinner.com/RegExr/ 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
- blaines 14y agoFlash uses Perl Compatible Regular Expression Engine (PCRE) http://www.pcre.org/ http://www.pcre.org/ Ruby uses Oniguruma http://www.geocities.jp/kosako3/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.
- deleted 14y ago[deleted]
- twelvechairs 14y agoRubular 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/ http://rubyxp.com/ is better for these descriptions.
- oscardelben 14y agoThanks. If you have any other ideas for improvement let me know. I've also open sourced the project at https://github.com/oscardelben/rubyxp https://github.com/oscardelben/rubyxp
- dasil003 14y agoI want this for sed / grep with optional shell interpolation
- walle_ 14y agoI made a clone of rubular a while back for testing javascript regexes. It's up on http://jsular.com/ http://jsular.com/ Code available at https://github.com/walle/jsular https://github.com/walle/jsular
- liangzan 14y agohere's another regular expression editor. but for javascript http://scriptular.com/ http://scriptular.com/
- dopamean 14y agoI 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.