Y
Hacker News
new
|
ask
|
show
|
jobs
Performance of Regular Expressions
(
medium.com
)
5 points
by
mrzasa
2783 days ago
1 comments
tsuberim
2783 days 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.
link
mrzasa
2783 days 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
link