in reply to Regex prob with interpolated patterns

Use the \1 form inside a regex, to refer to previously collected groups.

Use the $1 form anywhere else, including the right half of a s/// operator.

In your case, you will have to eval the results, but that's pretty easy: express the right hand as an expression, and add the /e option twice to your s/// operator. (This will require careful attention to tainting if you're security-conscious.)

--
[ e d @ h a l l e y . c c ]