Possible Duplicate:
Perl: How do you insert numbers after grouping variable?
I have the following perl one liner:
perl -pi.bak -e 's/(.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t)/$123424977\t/g if $. <= 200'
The problem is that I want to insert the number 23424977 after the grouped regex (.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t.*?\t).
But Perl thinks I’m referring to group $123424977 and doesn’t recognize I mean $1 and that 23424977 is the number I want to insert afterwards. How can I correct this?
simply refer to the $1 capture group with surrounding braces:
${1}: