From 734f2dc9694ebb3798ec09bc8ddd05a4c4675d6b Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Sun, 21 Aug 2022 15:10:47 +0100 Subject: [PATCH] Add `PCRE2_ALT_BSUX` to pcre pattern compilation This is the pcre2 equivalent of the PCRE_JAVASCRIPT_COMPAT flag we used previously. Compare bullet point 4 of the pcre2 compatibility docs: https://www.pcre.org/current/doc/html/pcre2compat.html to bullet point 5 of the pcre1 compatibility docs: https://www.pcre.org/original/doc/html/pcrecompat.html --- src/std/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/std/regexp.c b/src/std/regexp.c index 7a032dc7a..8187e771d 100644 --- a/src/std/regexp.c +++ b/src/std/regexp.c @@ -49,7 +49,7 @@ HL_PRIM ereg *hl_regexp_new_options( vbyte *str, vbyte *opts ) { size_t error_offset; pcre2_code *p; uchar *o = (uchar*)opts; - int options = PCRE2_UCP | PCRE2_UTF; + int options = PCRE2_ALT_BSUX | PCRE2_UCP | PCRE2_UTF; while( *o ) { switch( *o++ ) { case 'i':