Sure, you can interpolate there.
my $num_zeds = "13"; /z{$num_zeds}/
But you don't want interpolation. You want something like the following:
/(a+)(??{ 'x{'.length($1).'}' })/
In reply to Re: interpolating code in regex brace quantifier
by ikegami
in thread interpolating code in regex brace quantifier
by grobber
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |