Skip to content

Commit

Permalink
Fix regex for matching Unicode tokens to support any provided type pr…
Browse files Browse the repository at this point in the history
…efix (#225)
  • Loading branch information
slevithan committed Jan 18, 2021
1 parent bb35ead commit adf2ad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/addons/unicode-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default (XRegExp) => {
*/
XRegExp.addToken(
// Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}`
/\\([pP])(?:{(\^?)(?:(Script|sc)=)?([^}]*)}|([A-Za-z]))/,
/\\([pP])(?:{(\^?)(?:(\w+)=)?([^}]*)}|([A-Za-z]))/,
(match, scope, flags) => {
const ERR_DOUBLE_NEG = 'Invalid double negation ';
const ERR_UNKNOWN_NAME = 'Unknown Unicode token ';
Expand Down

0 comments on commit adf2ad8

Please sign in to comment.