in reply to Re^3: Regex curly bracket ambiguity
in thread Regex curly bracket ambiguity
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
|
|---|