Skip to content

Commit

Permalink
Add PCRE2_ALT_BSUX to pcre pattern compilation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tobil4sk committed Dec 1, 2022
1 parent 31e7810 commit 734f2dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/std/regexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 734f2dc

Please sign in to comment.