<regex>: Correct character translation in icase and collate mode by muellerj2 · Pull Request #5553 · microsoft/STL (original) (raw)

Is really that buggy, how did it even functionate?🤐

That's relatively easy to say: Most of the fixed bugs are or were specific to some subclasses of regexes (rarely used syntax options, specific escapes, wregex with specific character classes, usage of collating elements, icase or collate mode etc.), so if your regex wasn't in any of these subclasses, you weren't affected.

The bug fixed by this PR, for example, would only be observed if the traits classed provided (a) a non-trivial (or worse a non-idempotent) translate() function or (b) a non-idempotent translate_nocase() function. I'm not aware of any code that defined such translation functions. Well, except for the test code in this PR, but translation functions in the test code are deliberately weird to catch that they aren't applied exactly once. They aren't designed to do anything useful.