summaryrefslogtreecommitdiff
path: root/libregexp.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-03-13 19:00:25 +0100
committerFabrice Bellard <fabrice@bellard.org>2025-03-13 19:00:25 +0100
commit837a69758874339a75560d99cea665f1966799c8 (patch)
tree314089499bb675debe4629e61808480dad5b42c1 /libregexp.c
parent1be68b3345953c94e8072d12ad116e14403b66a8 (diff)
downloadquickjs-837a69758874339a75560d99cea665f1966799c8.tar.gz
quickjs-837a69758874339a75560d99cea665f1966799c8.zip
regexp: allow [\-] in unicode mode (#373)
Diffstat (limited to 'libregexp.c')
-rw-r--r--libregexp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libregexp.c b/libregexp.c
index 9295fe7..8c47389 100644
--- a/libregexp.c
+++ b/libregexp.c
@@ -686,6 +686,10 @@ static int get_class_atom(REParseState *s, CharRange *cr,
c = '\\';
}
break;
+ case '-':
+ if (!inclass && s->is_unicode)
+ goto invalid_escape;
+ break;
#ifdef CONFIG_ALL_UNICODE
case 'p':
case 'P':