The first thing that comes to mind is substracting the length of the match, like in:
pos ($state) - length $&--
David Serrano
In reply to Re^3: Finding the index of a string with a regexp
by Hue-Bond
in thread Finding the index of a string with a regexp
by OnionKnight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |