On 2014-07-01, Florian Lindner mailingli...@xgm.de wrote:
Is there a way I can extract the named groups from a regular
expression? e.g. given (?Ptestgrp\d) I want to get something
like [testgrp].
The match object has an attribute called groupdict, so you can get
the found named groups using
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
Hello,
Is there a way I can extract the named groups from a regular expression?
e.g. given (?Ptestgrp\d) I want to get something like [testgrp].
OR
Can I make the match object to return default values for named groups, even
if no match was produced?
Thanks,
Florian
--
Florian Lindner wrote:
Is there a way I can extract the named groups from a regular expression?
e.g. given (?Ptestgrp\d) I want to get something like [testgrp].
Easy, just write a regular expression to parse regular expressions ;)
(Sorry, I can't contribute something constructive, my first
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.
ChrisA
--
On 2014-07-01 16:12, Florian Lindner wrote:
Hello,
Is there a way I can extract the named groups from a regular expression?
e.g. given (?Ptestgrp\d) I want to get something like [testgrp].
OR
Can I make the match object to return default values for named groups, even
if no match was produced?
Chris Angelico 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
On Tuesday, 1 July 2014 16:12:34 UTC+1, Florian Lindner wrote:
Hello,
Is there a way I can extract the named groups from a regular expression?
e.g. given (?Ptestgrp\d) I want to get something like [testgrp].
OR
Can I make the match object to return default values for