2 comments

[ 2.7 ms ] story [ 16.6 ms ] thread
Isn't it O(n) where n is the length of the string to match? Because you can compile any regex to a DFA and run it over the string.