4 ms·
This is a really poorly-researched article. Had the author taken time to research regular expressions, he would have discovered the difference between DFA-base
by colanderman 9y ago
This is a really poorly-researched article.
Had the author taken time to research regular expressions, he would have discovered the difference between DFA-based and backtracking-based implementations. [1] He would have also discovered that the former (as implemented by, say, OCaml) not only gives performance independent of the number of words searched, but in fact creates and follows the exact same table as his bespoke algorithm, while covering a wider range of patterns.
(Yes, you can apply the DFA technique even when you need to query submatches. See Laurikari's thesis [2], which forms the basis of the OCaml regex implementation.)
[1] https://en.wikipedia.org/wiki/Regular_expression#Implementations_and_running_times https://en.wikipedia.org/wiki/Regular_expression#Implementat...
[2] https://laurikari.net/ville/regex-submatch.pdf https://laurikari.net/ville/regex-submatch.pdf