in reply to Re: regex question...
in thread regex question: $1 vs. \1

Additionally:
Although you can use \(digit) in the right side of a s/// operation, you shouldn't. This was included (i would guess) just to appease the sed junkies out there ;)

Generally the only time \(digit) should be used is on the LHS of a s///, or within a m//.
Example:
/(foo)\1/; # is effectively the same as /(foo){2}/;