I sometimes use <a href="http://regexio.com/" rel="nofollow">http://regexio.com/</a> to debug in the reverse direction: given a regex, generate a bunch of strings it matches, which sometimes quickly lets me see "wtf, why would it match strings like <i>that</i> one?"<p>That's something it'd be cool to see explored more; when I'm writing a regex, I usually have in mind a space of strings it's supposed to match, so a very useful debugging tool would be some way of showing me what that space is, so I can see if it's the same as the one in my head. I can't think of any cool infoviz tricks offhand that would be more useful than just a list of matching strings, but there must be something.
The interface is very clean, simple, and to the point. One suggestion though: It very quickly gives an "Invalid regular expression" error while I'm still typing. From the perspective of the regex parser that is certainly a correct assessment. However from a user's perspective, what's entered is simply incomplete. Although I like the instant evaluation/validation of the expression, it might be a good idea to increase the interval between when the last key is pressed and when the evaluation begins. The need to read the error message along with the textbox turning red while the regex is only incomplete causes an unneeded break in user interaction.<p>That aside, nice work! I'm sure I'll be using it. :)
My entry into this category of tools uses a (hidden) Java applet to avoid the need to send any data to a server (and the limits of the native JS regexp functionality). See:<p><a href="http://regex.powertoy.org" rel="nofollow">http://regex.powertoy.org</a><p>It also has an animate mode, which is most interesting on regexes with heavy backtracking. For example, animations of the famous 'prime-digits-count' regex, succeeding (composite) or failing (prime):<p>49: <a href="http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24/&syn=perlSyntax&anim=1&rep=&in=1111111111111111111111111111111111111111111111111" rel="nofollow">http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...</a><p>47: <a href="http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24/&syn=perlSyntax&anim=1&rep=&in=11111111111111111111111111111111111111111111111" rel="nofollow">http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...</a>
Great! It's very simple and useful.<p>One little thing, the regular expression input is in an html form, so if you hit enter (in most browsers) it POSTs to a blank page and you can lose your work. You can make the form onsubmit="return false;" if you never want it to submit.
Actually saw this as well today:<p><a href="http://txt2re.com" rel="nofollow">http://txt2re.com</a><p>Although I like yours better for what I'm doing.<p>Edit: was originally posted here (with a bad title and subsequently ignored):<p><a href="http://news.ycombinator.com/item?id=2449640" rel="nofollow">http://news.ycombinator.com/item?id=2449640</a>
Must be getting killed, times out for me.<p>Too bad, because I had wanted to see a python specific version of <a href="http://rubular.com" rel="nofollow">http://rubular.com</a>
Superb... but I have two major issues (aka <i>please</i> add these features:<p>1. Can you add an option to return the code for the actual Python function? Then we can just copy&paste right into our source<p>2. A cheat sheet like on rubular. Make it a pull-up menu from the bottom or something, so it doesn't clutter your nice layout too much
I think it needs an option to match all results, not just the first. This would let me test a regex against many strings at once. You could allow this by adding, below the bubbles, two radio buttons labeled "search" and "findall" - I those are the corresponding Python methods, as far as I can tell.
Awesome! Wish I had this a while ago during school. This is a good learning tool too since you can see how each addition affects the matching. I like Tycho's idea about have a little cheat sheet. That would add to the "learning tool" idea substantially.
I prefer <a href="http://rubular.com/" rel="nofollow">http://rubular.com/</a>, not because the language, but for '504 Gateway Time-out' when I connect to pythex.org right now. And I always connect to rubular.com successfully.
It would be nice if named groups were supported.
Something like: (?P<protocol>https)
Being captured like: protocol: https instead of 1: https<p>Nice work!! :)