Making regex suck less

Bengt Richter bokr at
Wed Sep 4 15:15:42 EDT 2002

On Wed, 04 Sep 2002 07:14:08 GMT, "Fredrik Lundh" <fredrik at> wrote:

>Bengt Richter wrote:
>> I agree about new syntax, but I wouldn't mind having a function
>> for interactive use that would just explain in 'English' what the regexp expression
>> stands for.
>you can ask SRE to dump the internal parse tree
>to stdout:
>>>> sre.compile("[a-z]\d*", sre.DEBUG)
>  range (97, 122)
>max_repeat 0 65535
>  in
>    category category_digit
>turning this into 'English' is left as an exercise etc.
Interesting, thanks. Does the above mean that sre can't fully match

Bengt Richter

More information about the Python-list mailing list