mirror of
https://gitee.com/openharmony/third_party_rust_regex
synced 2025-04-12 07:34:07 +00:00

The escaping of &, - and ~ is only required when the characters are repeated adjacently, which should be quite rare. Escaping of [ is always required, unless it appear in the second position of a range. These rules enable us to add character class sets as described in UTS#18 RL1.3 in a backward compatible way.