Boost logo

Boost :

From: Robert Mathews (rmathews_at_[hidden])
Date: 2005-05-20 15:59:18

"John Maddock" <john_at_[hidden]> wrote in message
> I noticed some surprising behavior with match_partial and regex_search.
> Consider:
> regex e("abc|b");
> string str("ab");
> smatch what;
> if(regex_search(str, what, e, match_default | match_partial))
> {
> cout << (what[0].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 ... ?


Boost list run by bdawes at, gregod at, cpdaniel at, john at