Take your "BUT" example and extend it:
perl -e "$_='qwerty'; s/r/print pos(). \"\n\";/e; print $_;OUTPUT:
3 qwe1ty
In reply to Re^9: Using pos() inside regexp (no /e)
by ww
in thread Using pos() inside regexp
by braveghost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |