Correct behaviour of \b when matching null-strings.

See https://github.com/boostorg/regex/issues/40
This commit is contained in:
jzmaddock
2018-07-21 15:19:41 +01:00
parent 867cc5f0fc
commit 231dbc3ebf
2 changed files with 29 additions and 2 deletions

View File

@ -476,12 +476,14 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary()
}
else
{
b = (m_match_flags & match_not_eow) ? true : false;
if (m_match_flags & match_not_eow)
return false;
b = false;
}
if((position == backstop) && ((m_match_flags & match_prev_avail) == 0))
{
if(m_match_flags & match_not_bow)
b ^= true;
return false;
else
b ^= false;
}