I don't think you can ever guarantee how the engine is going to backtrack. Sure, you could for a given point version of perl, but then japhy's going to submit a batch of patches, or Ilya Z will delurk on p5p, and the internal behaviour will get optimized. Or study will start working, and the backtracking will be different.
Besides, backtracking is internal behaviour; I don't think there's anything externally visible, apart from how long the regex takes, to indicate that backtracking is taking place. Well, apart from code blocks in the regex.
Even if you can come up with a way to do this, I don't think you really want to. Do you? I'm trying to come up with an application for this outside of golf, obfuscated code, or other JAPHs, and nothing springs to mind :)
--
Mike
In reply to Re: Requiring backtracking a certain number of times
by RMGir
in thread Requiring backtracking a certain number of times
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |