aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_regex.c')
-rw-r--r--src/core/ngx_regex.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/ngx_regex.c b/src/core/ngx_regex.c
index 991728b27..bebf3b6a8 100644
--- a/src/core/ngx_regex.c
+++ b/src/core/ngx_regex.c
@@ -159,7 +159,11 @@ ngx_regex_compile(ngx_regex_compile_t *rc)
options |= PCRE2_CASELESS;
}
- if (rc->options & ~NGX_REGEX_CASELESS) {
+ if (rc->options & NGX_REGEX_MULTILINE) {
+ options |= PCRE2_MULTILINE;
+ }
+
+ if (rc->options & ~(NGX_REGEX_CASELESS|NGX_REGEX_MULTILINE)) {
rc->err.len = ngx_snprintf(rc->err.data, rc->err.len,
"regex \"%V\" compilation failed: invalid options",
&rc->pattern)
@@ -275,7 +279,11 @@ ngx_regex_compile(ngx_regex_compile_t *rc)
options |= PCRE_CASELESS;
}
- if (rc->options & ~NGX_REGEX_CASELESS) {
+ if (rc->options & NGX_REGEX_MULTILINE) {
+ options |= PCRE_MULTILINE;
+ }
+
+ if (rc->options & ~(NGX_REGEX_CASELESS|NGX_REGEX_MULTILINE)) {
rc->err.len = ngx_snprintf(rc->err.data, rc->err.len,
"regex \"%V\" compilation failed: invalid options",
&rc->pattern)