Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4721: multiple capture groups with the same name break regex
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-12 20:57:17
#4721: multiple capture groups with the same name break regex
-------------------------------------+--------------------------------------
Reporter: robin.snyder@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords: regex named capture group
-------------------------------------+--------------------------------------
Comment (by anonymous):
Here is another pattern for testing.
{{{
(?<MPAT01>((?<MPAT01.zone>[0-5][0-9]|60)\s*)((?<MPAT01.band>[CcDdEeFfGgHhJjKkLlMmNnPpQqRrSsTtUuVvWwXx])\s*)(?<MPAT01.grid>[AaBbCcDdEeFfGgHhJjKkLlMmNnPpQqRrSsTtUuVvWwXxYyZz][AaBbCcDdEeFfGgHhJjKkLlMmNnPpQqRrSsTtUuVv])\s*(((?<MPAT01.easting>\d{5})\s*(?<MPAT01.northing>\d{5}))|((?<MPAT01.easting>\d{4})\s*(?<MPAT01.northing>\d{4}))|((?<MPAT01.easting>\d{3})\s*(?<MPAT01.northing>\d{3}))))([^\d]|$)
}}}
The easting northing pairs cause the first capture groups to be over
written by the latter ones
for [[BR]]
11spa 12345 67890[[BR]]
11spa 1234 6789[[BR]]
11spa 123 678[[BR]]
the last one is the only one that the capture groups work for.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4721#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC