[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
13.2.14 Disabling backtracking
Sometimes it is efficient to disable backtracking. For
example, we may wish to commit to a choice, or
we know that trying alternatives is fruitless. A
nonbacktracking regexp is enclosed in (?>
...)
.
(pregexp-match "(?>a+)." "aaaa") ⇒ #f
In this call, the subregexp ?>a*
greedily matches
all four a
’s, and is denied the opportunity to
backpedal. So the overall match is denied. The effect
of the regexp is therefore to match one or more a
’s
followed by something that is definitely non-a
.
This document was generated on March 31, 2014 using texi2html 5.0.