Skip to content

The most efficient way to search multiple texts with long common prefixs #1199

Answered by BurntSushi
Dan-wanna-M asked this question in Q&A
Discussion options

You must be logged in to vote

The full DFA is definitely ideal here in the sense that you can stop and start it in arbitrary states. So I can see how that would help with the longest common prefix here. And the full DFA is really the only engine capable of that. It might be possible to do the same with the PikeVM if you could abandon captures, but a "state" in that case wouldn't just be a single state ID, but an ordered set of state IDs. And of course, the PikeVM is quite a bit slower than the full DFA.

With that said... you said the magic words here:

untrusted regular expressions

And then here:

The warning on exponential memory and time complexity is definitely worrying though.

Yes indeed. You should be worried. …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Dan-wanna-M
Comment options

@BurntSushi
Comment options

Answer selected by Dan-wanna-M
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