Obviously not a universal solution, but may be insertion of a (?{ code }) block could be helpful:
$_ = 'I am sample'; while (m/(?<be>am)(?{say pos})/ig) { say $+{be}; }
In reply to Re: Finding match offsets of named captures in 5.10 regex
by Anonymous Monk
in thread Finding match offsets of named captures in 5.10 regex
by nobull
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |