in reply to Is RegEx in Perl not NFA anymore?
The perl regex algorithm/engine is neither DFA nor NFA. The description in Friedl's book is incorrect, and he later have explained that in his website: On the Terms “NFA,” “DFA,” and “Regular Expression”.
In a nutshell, he have used "NFA" to describe regex implementations that have backtracking or backreference, such as /(foo)\1/ matchin "foofoo".
The Perl engine (or almost any other regex implementation out there) cannot be any type of "FA" as it uses backtracking, either recursively or iteratively.
Principle of Least Astonishment: Any language that doesn’t occasionally surprise the novice will pay for it by continually surprising the expert
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is RegEx in Perl not NFA anymore?
by Laurent_R (Canon) on Oct 20, 2016 at 13:20 UTC | |
|
Re^2: Is RegEx in Perl not NFA anymore?
by Your Mother (Archbishop) on Oct 20, 2016 at 11:27 UTC |