manpagez: man pages & more
info bigloo
Home | html | info | man
[ << ] [ < ] [ 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 October 23, 2011 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.