[Bug libstdc++/84110] Null character in regex throws std::regex_error

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Sep 25 10:43:17 GMT 2021


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I agree ECMAScript should treat NUL as an ordinary char. POSIX doesn't though:

"The interfaces specified in POSIX.1-2017 do not permit the inclusion of a NUL
character in an RE or in the string to be matched. If during the operation of a
standard utility a NUL is included in the text designated to be matched, that
NUL may designate the end of the text string for the purposes of matching."

I'm not sure how that is supposed to translate to std::regex.


More information about the Gcc-bugs mailing list