I can't tell you why the backref doesn't work in a quantifier... but you could use the "postponed regex" construct (??{ code }):
my ($n, $v) = "3 aaa " =~ /^(\d+?) ((??{".{$1}"})) /; print "n=$n, v=$v\n"; # prints "n=3, v=aaa"
In reply to Re: Backref in a regex quantifier
by almut
in thread Backref in a regex quantifier
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |