From cc071fd4def875ff7603dc8f3838306f6f4bd123 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 12 Nov 2024 12:13:59 +0100 Subject: Enable PCRE2_ALT_CIRCUMFLEX --- src/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 72cc89c..40c9de4 100644 --- a/src/main.c +++ b/src/main.c @@ -320,8 +320,11 @@ pattern_comp(u8view_t pat) cerr(EXIT_FATAL, "Cannot pass flags to empty regex"); } else { u8view_t g; - uint32_t reopts = PCRE2_DOTALL | PCRE2_MATCH_INVALID_UTF - | PCRE2_MULTILINE | PCRE2_UTF; + uint32_t reopts = PCRE2_ALT_CIRCUMFLEX + | PCRE2_DOTALL + | PCRE2_MATCH_INVALID_UTF + | PCRE2_MULTILINE + | PCRE2_UTF; if (flags.i) reopts |= PCRE2_CASELESS; if (flags.l) @@ -353,8 +356,10 @@ pattern_comp(u8view_t pat) /* When doing literal matches we need to ensure the following options are disabled, otherwise PCRE2 complains loudly instead of just dealing with itâ„¢. */ - if (reopts & PCRE2_LITERAL) - reopts &= ~(PCRE2_DOTALL | PCRE2_MULTILINE | PCRE2_UCP); + if (reopts & PCRE2_LITERAL) { + reopts &= ~(PCRE2_ALT_CIRCUMFLEX | PCRE2_DOTALL + | PCRE2_MULTILINE | PCRE2_UCP); + } int ec; size_t eoff; -- cgit v1.2.3