Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rubular - a Ruby regular expression editor (rubular.com)
161 points by arb99 on Oct 23, 2012 | hide | past | favorite | 36 comments


I'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.


+1, it's really been a godsend for me


Rubular is one of my favorite examples of a perfectly designed site. It has everything you need and nothing you don't.


Totally agree. It inspired me to build http://strfti.me, and eventually the stamp gem.


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.


Thanks. If you have any other ideas for improvement let me know. I've also open sourced the project at https://github.com/oscardelben/rubyxp


I also like using 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


Flash uses Perl Compatible Regular Expression Engine (PCRE) http://www.pcre.org/

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.


Love rubular, use it every single time I write or edit a regex, just to test some weird cases while I think through the syntax.


+1 - I love Rubular and use it whenever I have to write regular expressions for fun or profit.


How does one write regular expressions for profit? Do you mean using regex's to filter datasets or do you actually sell regex's?


He/she is probably referring to paid work that involves regular expressions.


Bingo


I love rubular too. Question though... Why isn't it open source?


What would be gained if it were? I suppose you could run it locally. Come to think of it, that would be nice.


- 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_expressio...


as 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


It's not much more than a webapp wrapper around Ruby's built-in regex functionality.


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.


I made a clone of rubular a while back for testing javascript regexes. It's up on http://jsular.com/ Code available at https://github.com/walle/jsular


That's very nice.

For Python users, there is: http://www.regexplanet.com/advanced/python/index.html

Example: http://fiddle.re/22e5


for python i use http://re-try.appspot.com


here's another regular expression editor. but for javascript http://scriptular.com/


I use this quite a bit. Also displays named captures with values which is nice.


I want this for sed / grep with optional shell interpolation


Didn't know about this. Love it! Thanks for sharing.


I've been using this since '09. I love it!


i didn't realize that it was possible to name a capturing group. this is an awesome example.


ruby > 1.9


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 can thank Michael Hartl for showing me this gem in the Rails tutorial.


And this is why hacker news is terrible.


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).


You aren't making it better.

Karma: 11 / 663 days old

http://news.ycombinator.com/user?id=rross0227


What does that have to do with it?

Adding more quality submissions or comments wouldn't have prevented this submission from being upvoted.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: