Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Performance of Regular Expressions | Better HN
Performance of Regular Expressions
(medium.com)
5 points · by
mrzasa
· 8y ago · 2 comments
Comments
[–]
tsuberim
8y ago
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.
[–]
mrzasa
OP
8y ago
Not sure what you mean. For detailed complexity analysis, please read this excellent post by Russ Cox:
https://swtch.com/~rsc/regexp/regexp1.html