diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-11-12 12:13:59 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-11-12 12:13:59 +0100 |
commit | cc071fd4def875ff7603dc8f3838306f6f4bd123 (patch) | |
tree | f274392778fac94f26b6895111fda0a53ed925de /src/main.c | |
parent | 57a3159d5c441837607866fea848075055e03c89 (diff) |
Enable PCRE2_ALT_CIRCUMFLEX
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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; |