From 837a69758874339a75560d99cea665f1966799c8 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Thu, 13 Mar 2025 19:00:25 +0100 Subject: [PATCH] regexp: allow [\-] in unicode mode (#373) --- libregexp.c | 4 ++++ 1 file changed, 4 insertions(+) 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':