Possible Duplicate:
How to concatenate $1 with number in a regex
I am trying to replace all instances of SomeText in my file with SomeText2 using a simple regex replace from the command line (on Windows):
perl -pi.bak -e "s/(SomeText)/$12/g" sometext.txt
This doesn’t work because there is no $12 selection. How can I properly indicate the $1 selection token without a space after it?
${1}As a general rule, inside a Regexp or interpolated string literal, you can use
{}after any$or@sigil to explicitly delimit the name of the variable you care about.And yes, as @Mat says, if you’re on a Unix system of some kind, use single quotes.