26 comments

[ 3.7 ms ] story [ 59.4 ms ] thread
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.

That aside, nice work! I'm sure I'll be using it. :)

I prefer http://rubular.com/, 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.
Must be getting killed, times out for me.

Too bad, because I had wanted to see a python specific version of http://rubular.com

I'm glad there's a non-flash version of this, but if you use a mac, RegExhibit is awesome.
Great tip, I will check it out.I just saw there is a tool in the mac app store for 4.99 called patterns that looks pretty good too.
Sorry, I wasn't expecting to be hackernews'ed and pythex.org is running on a tiny Gandi.net slice with 256MB RAM. I'm temporarily redirecting it to a mirror in App Engine: http://pythex.appspot.com

Hope you can try it now!

Why not keep it on App Engine permanently so you don't have to worry about it going down again?
(comment deleted)
It would be nice if named groups were supported. Something like: (?P<protocol>https) Being captured like: protocol: https instead of 1: https

Nice work!! :)

Great tip! I don't know why I didn't think of that before. I'll sure be adding it as soon as I can :-)
Great! It's very simple and useful.

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.

Rubular is still nicer, part of the charm was the small cheat sheet at the bottom of the page.
I sometimes use http://regexio.com/ 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 that one?"

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.

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.
Superb... but I have two major issues (aka please add these features:

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

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

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

http://regex.powertoy.org

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

49: http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...

47: http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...