https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124000
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #0)
> We throw an exception for this regex, which libc++ accepts:
>
> #include <regex>
> int main() {
> std::regex("\\{a\\}", std::regex::extended)
> }
>
> terminate called after throwing an instance of 'std::regex_error'
> what(): Invalid escape in regular expression
To be more precise, we throw an exception for strict -std=c++NN modes. For
-std=gnu++NN modes we ignore the backslash and treat the escaped character as
an ordinary character.
> So we should relax our implementation to accept \] and \} as equivalent to ]
> and } respectively.
i.e. we should do that even for strict -std modes.