Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73794 > unrolled thread
| Started by | Peter Otten <__peter__@web.de> |
|---|---|
| First post | 2014-07-01 17:29 +0200 |
| Last post | 2014-07-01 17:29 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Get named groups from a regular expression Peter Otten <__peter__@web.de> - 2014-07-01 17:29 +0200
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2014-07-01 17:29 +0200 |
| Subject | Re: Get named groups from a regular expression |
| Message-ID | <mailman.11372.1404228575.18130.python-list@python.org> |
Florian Lindner wrote: > Is there a way I can extract the named groups from a regular expression? > e.g. given "(?P<testgrp>\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 idea, re.DEBUG doesn't help) > OR > > Can I make the match object to return default values for named groups, > even if no match was produced?
Back to top | Article view | comp.lang.python
csiph-web