
Rubular - a Ruby regular expression editor - arb99
http://rubular.com/r/xfQHocREGj
======
Falling3
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.

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

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

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

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

~~~
oscardelben
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>

------
danso
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

~~~
blaines
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.

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

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

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

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

~~~
skram
Bingo

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

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

~~~
blaines
\- 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...](http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines)

~~~
riffraff
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>

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

------
walle_
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>

------
cynwoody
That's very nice.

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

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

~~~
TheSmoke
for python i use <http://re-try.appspot.com>

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

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

------
dasil003
I want this for sed / grep with optional shell interpolation

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

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

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

~~~
aaronblohowiak
ruby > 1.9

~~~
pjscott
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'}

------
lolwutreddit
I can thank Michael Hartl for showing me this gem in the Rails tutorial.

------
rross0227
And this is why hacker news is terrible.

~~~
Falling3
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.

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

