by User23 · 7y ago · 0 comments
That includes basic things like capture groups. That doesn't mean you can't use automata in a regex-plus implementation, though.
I can't find the paper, but I think there is a hybrid engine that tries to get the best of both worlds; constant space where possible and using additional space to provide more features.
You might have meant to say that you can't use backreferences.
Fun trivia: DFAs and NFAs are computationally equivalent. Any NFA can be converted into an equivalent DFA.
https://en.wikipedia.org/wiki/Deterministic_finite_automaton
> ...not as powerful as regex libs built with a non-regular language...
I've wondered about that, but I can't think of a realistic example where that would really matter.Is there something that perl regex's can do, in non-crazy everyday use-cases, that can't be done by something like re2?
I don't think it's proven that they can't be added on to an automata based regular expression engine. Nobody has figured it out yet though.
If you can convert a nondeterministic automata to a deterministic one, doesn't that mean they are all deterministic?
Said another way: a state machine. True regular languages can be defined by a simple state machine, which is relatively much faster than the extended regular-like language that perl exposes.