Open mesqueeb opened 1 year ago
The issue is that there's a difference between JavaScript and PCRE syntax in these \p
values and Regexr just parses them like PCRE, even when you tell it it's JavaScript.
PCRE allows
\pL
\p{L}
\p{Han}
Whereas JavaScript allows
\p{L}
\p{Script=Han}
\p{Letter}
(note it doesn't allow \pL
)
In PCRE, some text by its own is treated as a Script/Script_Extension/General Category (and if it's not a matching possible value in any of the 3 then that's an error) and in JavaScript some text by its own is just as the General Category
(and if it's not a valid General Category
, i.e. \p{Han}
is a Script
not a General Category
, then that's an error) so it has the extra Script=Han
syntax which PCRE doesn't have, so the parser needs to know if it's parsing JavaScript or PCRE.
The error happens in here
even though it matches fine: