<regex>: Repair character class escapes outside character class definitions by muellerj2 · Pull Request #5160 · microsoft/STL (original) (raw)

Partially addresses #992 (or, from a different perspective, fixes the issue exposed by the provided test case).

After this change, class escapes are handled correctly when they appear outside character class definitions, but not when they are used inside them. So regular expressions like \S or \D do work correctly now, but [\S], [\D] or [0\D] still show the defective behavior.

The fix uses the observation that \A for some negated character class A is equivalent to the class definition [^\a] and [^\a] is handled correctly by parser and matcher.

Drive-by change: Removes useless boolean parameter from _Parser::_ClassEscape.