<regex>: Restrict control letters in escapes to alphabetic ASCII characters by muellerj2 · Pull Request #5524 · microsoft/STL (original) (raw)

Towards #995. ECMAScript 15.10.1 defines the production ControlLetter such that only ASCII alphabetic characters are allowed. Such restricted character sets are often extended to corresponding POSIX character classes (to include Unicode characters) by Boost.Regex or <regex> implementations. But such an extension doesn't make much sense in this specific case, because these \c + letter escapes are supposed to emulate what pressing Ctrl + ASCII character does in the terminal. (It would actually make more sense to support "\c[" and similar, but the ECMAScript standard doesn't say so.)

Alternative: If non-ASCII characters should remain supported, we could query the bitmask of the character class "alpha" from the traits class.