Skip to content
Discussion options

You must be logged in to vote

regex-automata has a size limit option because the size of the input (the length of the sum of the patterns) is not proportional to the size of the compiled regex. The only reason why this is true is because of counted repetitions. i.e., .{100}{100}{100}.

But AhoCorasick doesn't support anything like that. So the way to apply a size limit is to limit the length of the patterns. Namely, the size of the resulting AhoCorasick value should be proportional to the sum of the lengths of the patterns.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
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
Converted from issue

This discussion was converted from issue #160 on June 18, 2025 13:44.