[Bug libstdc++/124004] Positive lookahead (?=^) matches incorrectly with std::regex

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 6 19:14:06 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124004

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
What about word boundary instead of line-begin, i.e.

  std::regex_search("ab", std::regex("a(?=\\b)b")

We also accept this which seems wrong.  libc++ accepts it too though (but it
rejects the line-begin version)


More information about the Gcc-bugs mailing list