summaryrefslogtreecommitdiff
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index bb8c982f..aa6c56e6 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1203,13 +1203,6 @@ collection:
}
mb_ptr_adv(regparse);
- if (extra == ADD_NL) /* \_[] also matches \n */
- {
- EMIT(reg_string ? NL : NFA_NEWL);
- TRY_NEG();
- EMIT_GLUE();
- }
-
/* skip the trailing ] */
regparse = endp;
mb_ptr_adv(regparse);
@@ -1219,6 +1212,14 @@ collection:
EMIT(NFA_END_NEG_RANGE);
EMIT(NFA_CONCAT);
}
+
+ /* \_[] also matches \n but it's not negated */
+ if (extra == ADD_NL)
+ {
+ EMIT(reg_string ? NL : NFA_NEWL);
+ EMIT(NFA_OR);
+ }
+
return OK;
} /* if exists closing ] */