From 893df527f5de925a68b41e947d587eef6c1373e6 Mon Sep 17 00:00:00 2001 From: Christophe Eymard Date: Mon, 22 Jun 2026 11:59:52 +0200 Subject: [PATCH] allow unicode properties in unquoted identifiers --- src/regexps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regexps.ts b/src/regexps.ts index 181beef..180e98b 100644 --- a/src/regexps.ts +++ b/src/regexps.ts @@ -1,5 +1,5 @@ -export const unquotedPropertyRegex = /^[a-zA-Z_$][a-zA-Z\d_$]*$/ -export const startsWithUnquotedPropertyRegex = /^[a-zA-Z_$][a-zA-Z\d_$]*/ +export const unquotedPropertyRegex = /^[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}_$]*$/u +export const startsWithUnquotedPropertyRegex = /^[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}_$]*/u export const startsWithStringRegex = /^"(?:[^"\\]|\\.)*"/ // https://stackoverflow.com/a/249937/1262753 export const startsWithNumberRegex = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/ // https://stackoverflow.com/a/13340826/1262753 export const startsWithIntRegex = /^(0|[1-9][0-9]*)/