
Pythex: a Python regular expression editor - teoruiz
http://pythex.org/
======
_delirium
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.

~~~
bane
You'll probably like [http://research.microsoft.com/en-
us/downloads/7f1d87be-f6d9-...](http://research.microsoft.com/en-
us/downloads/7f1d87be-f6d9-495d-a699-f12599cea030/)

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

------
gojomo
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...](http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\\1+%24/&syn=perlSyntax&anim=1&rep=&in=1111111111111111111111111111111111111111111111111)

47:
[http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...](http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\\1+%24/&syn=perlSyntax&anim=1&rep=&in=11111111111111111111111111111111111111111111111)

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

------
sedachv
There's <http://weitz.de/regex-coach/> , which you don't need an Internet
connection to use.

~~~
stevejohnson
It's also Windows only and not specifically for Python, whose regex library
has unique features and quirks..

------
larrik
Actually saw this as well today:

<http://txt2re.com>

Although I like yours better for what I'm doing.

Edit: was originally posted here (with a bad title and subsequently ignored):

<http://news.ycombinator.com/item?id=2449640>

------
mgrouchy
Must be getting killed, times out for me.

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

~~~
orenmazor
I'm glad there's a non-flash version of this, but if you use a mac, RegExhibit
is awesome.

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

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

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

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

------
adamtj
<http://kodos.sourceforge.net/>

~~~
blogimus
Kodos hasn't seen a release since 2006

~~~
silentbicycle
Have Python regular expressions changed much since then, though? It may be
good enough.

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

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

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

------
makmanalp
This is also good: <http://www.cuneytyilmaz.com/prog/jrx/>

------
zquestz
Rubular is still nicer, part of the charm was the small cheat sheet at the
bottom of the page.

