Sequence properties in Unicode property escapes
const reGreekSymbol = /\p{Script_Extensions=Greek}/u;�reGreekSymbol.test('π');�// → true
const re = /\p{RGI_Emoji_ZWJ_Sequence}/u;�re.test('👨🏾⚕️'); // '\u{1F468}\u{1F3FE}\u200D\u2695\uFE0F'�// → true
const reBasicEmoji = /\p{Basic_Emoji}/u;�reBasicEmoji.test('⌚'); // '\u231A'
// → true
reBasicEmoji.test('⏲️'); // '\u23F2\uFE0F'�// → true
// mental model for developers:
\p{Foo}
refers to the Unicode property Foo
\p{Foo}
refers to the Unicode
non-sequence property Foo
// alternative mental model:
\q{Bar}
refers to the Unicode
sequence property Bar
// Unified syntax with \p{…}
\p{Emoji} // works
\P{Emoji} // works
[\p{Emoji}] // works
[^\p{Emoji}] // works
\p{RGI_Emoji_ZWJ_Sequence} // works
\P{RGI_Emoji_ZWJ_Sequence} // throws an exception
[\p{RGI_Emoji_ZWJ_Sequence}] // throws an exception
[^\p{RGI_Emoji_ZWJ_Sequence}] // throws an exception
\p{InVaLiD} // throws an exception
\P{InVaLiD} // throws an exception
// Disunified syntax with \p{…} and \q{…}
\p{Emoji} // works
\P{Emoji} // works
[\p{Emoji}] // works
[^\p{Emoji}] // works
\q{Emoji} // throws an exception
[\q{Emoji}] // throws an exception
[^\q{Emoji}] // throws an exception
\p{RGI_Emoji_ZWJ_Sequence} // throws an exception
\P{RGI_Emoji_ZWJ_Sequence} // throws an exception
\q{RGI_Emoji_ZWJ_Sequence} // works
\Q{RGI_Emoji_ZWJ_Sequence} // throws an exception
[\p{RGI_Emoji_ZWJ_Sequence}] // throws an exception
[^\p{RGI_Emoji_ZWJ_Sequence}] // throws an exception
[\q{RGI_Emoji_ZWJ_Sequence}] // throws an exception
[^\q{RGI_Emoji_ZWJ_Sequence}] // throws an exception
\p{InVaLiD} // throws an exception
\P{InVaLiD} // throws an exception
\q{InVaLiD} // throws an exception
\Q{InVaLiD} // throws an exception
Unified or disunified?