aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
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;