Skip to content
Discussion options

You must be logged in to vote

It is 100% not a bug. I'm confused as to where you are confused. You already mentioned the 1 byte delay, so you know about that. And that is why there is a delay here. If you extend the input by one more byte, you can see it enter a dead state: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=5a35c4fd4a94eb64799d392d1cadbac2

Maybe the thing you are confused by is that you as a human can see that the regex can never match. But the engine itself cannot because the 1 byte delay is built into the finite state machine, even when a pattern doesn't have any look around assertions.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@mehdi-pplx
Comment options

@BurntSushi
Comment options

Answer selected by BurntSushi
@BurntSushi
Comment options

@mehdi-pplx
Comment options

@BurntSushi
Comment options

@mehdi-pplx
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants