Skip to content

Commit a5d8a9e

Browse files
Disable lookaround scanning when none present
1 parent 0af9347 commit a5d8a9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

regex-automata/src/nfa/thompson/pikevm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ impl PikeVM {
12731273

12741274
if let Some(active) = match_lookaround {
12751275
*curr_lookaround = active.clone();
1276-
} else {
1276+
} else if self.lookaround_count() > 0 {
12771277
// This initializes the look-behind threads from the start of the input
12781278
// Note: since capture groups are not allowed inside look-behinds,
12791279
// there won't be any Capture epsilon transitions and hence it is ok to

0 commit comments

Comments
 (0)