[Python-Dev] Re: hierarchicial named groups extension to
the re library
Phillip J. Eby
pje at telecommunity.com
Sun Apr 3 16:30:21 CEST 2005
At 08:48 AM 4/3/05 +0200, Martin v. Löwis wrote:
>I personally think that the proposed functionality should *not* live
>in a separate module, but somehow be integrated into SRE.
+1.
> Whether or
>not the proposed functionality is useful in the first place, I don't
>know. I never have nested named groups in my regular expressions.
Neither have I, but only because it doesn't do what re2 does. :)
I'd like to suggest that the addition also allow you to match a group by a
named reference, thus allowing a complete grammar to be formed. Of course,
I don't know if the underlying regular expression engine could actually do
that, but it would be nice if it could, since it would allow simple
grammars to be more easily parsed without recourse to a more complex
parsing module.
More information about the Python-Dev
mailing list