by arnsholt · 14y ago · 0 comments
Could easily be added as a modifier (see `man perlre`), but should be implemented as two to enable explicit behavior and toggling the default. Randomly picking the letter N:
/(\w+) \1/n # Error: look-behind is incompatible with linear runtime RE engine
/(\w+) \1/N # Works!
/(\w+) \1/ # Preferable works for backwards compat, maybe overridden by an ENV varMy claim was that there should be a modifier to demand a particular performance characteristic. i.e. "I want an error if I do something stupid"
Assuming that means that a library function exists to verify that no linearity-breaking features are used, you could also use that to validate user input, which may be good enough.