<regex>: Remove non-standard _Uelem from matcher by muellerj2 · Pull Request #5671 · microsoft/STL (original) (raw)

Resolves #995 by eliminating _Uelem completely.

This PR does not quite complete support for custom character types: The internals of regex_search still place some additional requirements on such types. But except for ADL resilience, the support should be complete for regex_match, as the passing test confirms.

<regex> changes

Test changes

The test coverage for custom character types largely remains rudimentary, but I added some test coverage that matching behaves as it should in places where the parser and matcher rely on potentially narrowing conversions.

The test covers the matcher changes in this PR: Word boundaries (_Is_word), single character matching (_Matcher2::_Do_class), character ranges (_Lookup_range) and line terminators (_Is_ecmascript_line_terminator). Additionally, some of the character ranges are chosen to validate that the implementation of _Builder::_Add_range remains correct for custom character types.

Beyond this, I made the following changes to tests: