YOCKOW
(YOCKOW)
July 5, 2022, 12:32am
7
xwu:
I'm concerned that extended grapheme cluster-based matching is both unique to Swift and also the (silent) default. Compatibility with other regex engines has been a key consideration in this series of proposals, and it is specifically desired with respect to the classical regex syntax. As the proposal acknowledges, extended grapheme cluster-based matching by default decreases that level of broad compatibility.
I agree, while my opinion was expressed in a different way .
xwu:
Support a "Unicode normalization–insensitive" option for regex, enabled by default for regex literals
Where the "Unicode normalization–insensitive" option is enabled, normalize the regex and match against the normalized string representation (i.e., do automatically what the proposal says one must do manually when using regex engines in other languages)
Drop grapheme cluster-level semantics from the proposal; in place of matchingSemantics
, add an ignoresNormalizationForm()
option (strawman name) that defaults to being enabled, and possibly an in-regex syntax for toggling the same option
I may have read it perversely, but I wonder why you use the term "normalization".
I mean we can't ignore some normalization forms such as NFKC and NFKD that are not for the purpose of searching.