From: Eric Niebler (eric_at_[hidden])
Date: 2005-05-20 16:39:36
Robert Mathews wrote:
> "John Maddock" <john_at_[hidden]> wrote in message
> > I noticed some surprising behavior with match_partial and regex_search.
> > Consider:
>>if(regex_search(str, what, e, match_default | match_partial))
>> cout << (what.matched ? "full" : "partial") << '\n';
>>This code displays "partial". Clearly, regex_search is bombing out just as
>>soon as it finds a match, partial or otherwise. But in this case, if it
>>kept looking, it would find a full match.
> Very stupid question, I guess, but I had to ask:
> The regex "abc|b" means either "abc" or "b". How could "ab" provide a full
> match if it kept looking ... ?
It could match the "b" in "ab". (We're talking about regex_search, not
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk