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


Groups > comp.lang.python > #88663

How to find out which named regular expression group corresponds to which positional regex group

Date 2015-04-08 15:23 +0200
Subject How to find out which named regular expression group corresponds to which positional regex group
From Mattias Ugelvik <uglemat@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.138.1428499489.12925.python-list@python.org> (permalink)

Show all headers | View raw


I'm making a string manipulation tool in which I need to know this correlation.

Take this example: re.match('(?P<first>a?)(?P<second>b?)', '')

I need to know that 'first' is group #1, and 'second' is group #2. I
need this to resolve certain ambiguities. I was hopin

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


Thread

How to find out which named regular expression group corresponds to which positional regex group Mattias Ugelvik <uglemat@gmail.com> - 2015-04-08 15:23 +0200
  Re: How to find out which named regular expression group corresponds to which positional regex group Damien Wyart <damien.wyart@free.fr> - 2015-04-08 15:32 +0200

csiph-web