3 ms·
Yeah, but writing your own engine will help you understand why your innocent-looking expression has stupid exponential performance. (Assuming you implement some
by tikhonj 14y ago
Yeah, but writing your own engine will help you understand why your innocent-looking expression has stupid exponential performance. (Assuming you implement something akin to Perl-style regexps that use backtracking rather than actually regular expressions using an NFA.)
It will also help you understand why engines like re2[1] are absurdly faster than normal engines.
[1]: http://code.google.com/p/re2/ http://code.google.com/p/re2/
In short: it's a great learning exercise. Also, I suggest learning the basic theory behind it (Chomsky hierarchy and so on)--it's very fascinating.
- dizidoro 14y agoNon deterministic regex engine is just plain stupidity. Am i missing something?