regex-colorizer icon indicating copy to clipboard operation
regex-colorizer copied to clipboard

Mark invalid values for \p{...} with flag u as errors

Open slevithan opened this issue 1 year ago • 1 comments

When using flag u, Regex Colorizer (as of v1.0.0) uses a simplistic regex to identify Unicode properties with \p{...} and \P{...}. It would be better to flag any values that are not actually supported by ECMAScript.

@mathiasbynens has a bunch of great, related libraries. See:

Not yet sure which of these are the most relevant.

slevithan avatar May 18 '24 17:05 slevithan

regexpu-core uses unicode-match-property-ecmascript and unicode-match-property-value-ecmascript. I think you'll want the same packages. Note that they deal with character properties only, not properties of strings.

The v flag also adds support for the following properties of strings:

Basic_Emoji
Emoji_Keycap_Sequence
RGI_Emoji_Modifier_Sequence
RGI_Emoji_Flag_Sequence
RGI_Emoji_Tag_Sequence
RGI_Emoji_ZWJ_Sequence
RGI_Emoji

mathiasbynens avatar May 18 '24 18:05 mathiasbynens