aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-11-12 12:13:59 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-11-12 12:13:59 +0100
commitcc071fd4def875ff7603dc8f3838306f6f4bd123 (patch)
treef274392778fac94f26b6895111fda0a53ed925de /src/main.c
parent57a3159d5c441837607866fea848075055e03c89 (diff)
Enable PCRE2_ALT_CIRCUMFLEX
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 9 insertions, 4 deletions
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;