List Info

Thread: A christmas wish: simple notation for ratcheting (non-backtrack) regex




A christmas wish: simple notation for ratcheting (non-backtrack) regex
user name
2006-12-26 01:45:13
Randal L. Schwartz <merlyn <at> stonehenge.com>
writes:
> How about making it so that any quantifier (including
lazily modified
> quantifers) followed by "+" means "never
backtrack"?

That's awfully simple and clever.  How about |+, too, so
/a|+b|c/ would mean the same as /(?>a|b)|c/?

A non trivial example:
/d+(?:.d+)?|+w+|W+/ would mean the same as
/(?>d+(?:.d+)?|w+)|W+/


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )