The pos() works only outside of matching.
Except when it works inside of matching ;)
$ perl -le'() = "abcdef" =~ /..(?{ print pos() })/g;' 2 4 6
In reply to Re^4: Using pos() inside regexp (no /e)
by ikegami
in thread Using pos() inside regexp
by braveghost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |