Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73792

Get named groups from a regular expression

From Florian Lindner <mailinglists@xgm.de>
Subject Get named groups from a regular expression
Date 2014-07-01 17:12 +0200
Newsgroups comp.lang.python
Message-ID <mailman.11370.1404227582.18130.python-list@python.org> (permalink)

Show all headers | View raw


Hello,

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"].

OR

Can I make the match object to return default values for named groups, even 
if no match was produced?

Thanks,
Florian

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Get named groups from a regular expression Florian Lindner <mailinglists@xgm.de> - 2014-07-01 17:12 +0200
  Re: Get named groups from a regular expression jkn <jkn_gg@nicorp.f9.co.uk> - 2014-07-01 13:49 -0700
  Re: Get named groups from a regular expression Philip Shaw <jnufcvyvuc@tznvy.pbz> - 2014-07-03 23:30 +0000

csiph-web