$r="\"end{$1}\"";
The double quotes interpolate the $1. Use $r=q("end{$1}") in this case.
In reply to Re^3: Pass Matched Variable into Regex Replace Variable
by Anonyrnous Monk
in thread Pass Matched Variable into Regex Replace Variable
by deMize
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |