3 ms·
If you are really using a state machine and every match in the regex is at the end of the haystack, then you can reverse the state machine and use the same algo
by burntsushi 10y ago
If you are really using a state machine and every match in the regex is at the end of the haystack, then you can reverse the state machine and use the same algorithm you described in reverse. :-)
(Rust's regex engine does this.)