First page Back Continue Last page Overview Graphics
Backtracking Control Verbs
(*PRUNE)
- when backtracked into, the match fails at the current starting position.
- similar to (?>...) except that prune is unary and not a bracketing construct. Thus you can write:
- /A (? B | C (*PRUNE) ) D/
- Can be used with (*FAIL) to find the longest match possible for every start position in the string.
- /a+b?(?{print $&})(*PRUNE)(*FAIL)/