f*cking re module

Kay Schluehr kay.schluehr at gmx.net
Fri Jul 8 17:33:11 CEST 2005


jwaixs schrieb:
> arg... I've lost 1.5 hours of my precious time to try letting re work
> correcty.

1.5 hours are not enough for understanding regular expressions. But to
be honest: I never had the patience to learn them accurately and I
guess I will never do so as well as I don't ever learn sed or awk or
Perl. When my brain hit regexp syntax the first time I thought about
writing a little language that translates readable Python expressions
in awkward regexps as an intermediary language which gets finally
compiled into a finite state-machine descriptions. Fortunately I was
not the first one who considered his mental weakness/aesthetic
repulsion as a virtue:

http://home.earthlink.net/~jasonrandharper/reverb.py

I never took time for a critical review. The module just worked for my
purposes.

Kay




More information about the Python-list mailing list