[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: english names for symbolic SREs

This page is part of the web mail archives of SRFI 115 from before July 7th, 2015. The new archives for SRFI 115 contain all messages, not just those from before July 7th, 2015.

On Thu, Nov 28, 2013 at 10:46 AM, John Cowan <cowan@xxxxxxxxxxxxxxxx> wrote:

Note that Java
has not only greedy and reluctant (= non-greedy), but also possessive
(notated *+, matches everything, never backtracks).  I have been unable
to see the use of this, however.

This, unsurprisingly, is also originally from PCRE,
where PAT*+ a shortcut for (?>PAT*), available as
(atomic (* PAT)) in IrRegex.

It's an optimization technique to avoid exponential
backtracking, analogous to cut in Prolog.  Thus
by definition it only makes sense in a specific
backtracking implementation.