If you used regular parens around $match, it would be returned in $2.That is, the last repetition would be returned in $2:
$ perl -w $match = "ab+"; $string = "fooababbabbbar"; $string =~ /(($match){3})/ && print "\$1: $1 \$2: $2\n"; __END__ $1: ababbabbb $2: abbb
In reply to Re^4: Regex curly bracket ambiguity
by ysth
in thread Regex curly bracket ambiguity
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |