3 ms·
That does searching of text, without generating an index. While this is fast, you are still have search time linear in the size of your searchable text. If yo
by fizx 17y ago
That does searching of text, without generating an index. While this is fast, you are still have search time linear in the size of your searchable text.
If you used a suffix tree as an index, you'd get time complexity strongly sublinear in text length.
In summary, if the regex matching complexity dwarfs the corpus size, you want Thompson NFA. If your corpus size dwarfs the regex complexity, you want suffix tree indexes. It's not clear to me if the two approaches can be combined, but if they are, I'd like to know.