5 ms·
Easy with a sufficiently powerful engine: https://stackoverflow.com/a/4234491 https://stackoverflow.com/a/4234491 Relies on ?(DEFINE): http://p3rl.org/perlre#(
by bmn__ 7y ago
Easy with a sufficiently powerful engine: https://stackoverflow.com/a/4234491 https://stackoverflow.com/a/4234491
Relies on ?(DEFINE): http://p3rl.org/perlre#(DEFINE) http://p3rl.org/perlre#(DEFINE)
- quickthrower2 7y agoThere is a good comment on that answer: > To sum up: RegEx's are misnamed. I think it's a shame, but it won't change. Compatible 'RegEx' engines are not allowed to reject non-regular languages. They therefore cannot be implemented correctly with only Finte State Machines. The powerful concepts around computational classes do not apply. Use of RegEx's does not ensure O(n) execution time. The advantages of RegEx's are terse syntax and the implied domain of character recognition. To me, this is a slow moving train wreck, impossible to look away, but with horrible consequences unfolding