On Tue, Jul 1, 2014 at 8:58 AM, Chris Angelico <ros...@gmail.com> wrote: > On Wed, Jul 2, 2014 at 1:29 AM, Peter Otten <__pete...@web.de> wrote: >> Easy, just write a regular expression to parse regular expressions ;) > > Hmm, is that even possible? AIUI you can't make a regex that correctly > parses nested tokens, and named groups can definitely be nested.
Nesting isn't inherently a problem. Since nesting doesn't change the way they parse, you can ignore nesting for the purposes of pulling out named groups. Find each unescaped "(?P<...>". (Making sure they are unescaped is annoying, though.) -- Devin -- https://mail.python.org/mailman/listinfo/python-list