Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2165: regex_search match but regex_match is not filled
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-08-05 10:56:48
#2165: regex_search match but regex_match is not filled
-----------------------------------+----------------------------------------
Reporter: mickael_at_[hidden] | Owner: johnmaddock
Type: Bugs | Status: closed
Milestone: Boost 1.36.0 | Component: regex
Version: Boost 1.35.0 | Severity: Problem
Resolution: invalid | Keywords: regex_search regex_match
-----------------------------------+----------------------------------------
Changes (by johnmaddock):
* status: new => closed
* resolution: => invalid
Comment:
I believe this is a misunderstanding of how regular expressions work: if
the expression is [a-z]* then it is perfectly legal to match a zero-length
string if the * operator ''repeats zero times''. So for example [a-z]*
matched against the string " abc " can find 4 matches:
* the zero length string at the start of the " abc ".
* the string "abc".
* the zero length string after the "c".
* the zero length string at the end of " abc ".
When a zero length string is matched, then sub_match::first ==
sub_match::second and sub_matched::matched == true.
Probably you meant to use [a-z]+ as the regular expression?
If this doesn't clarify the issue, or if I've misunderstood, please reopen
the ticket.
HTH & bonjour, John Maddock.
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2165#comment:1> 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:49:58 UTC