I'm throwing in the towel in this one. I'm trying to use this Rex sed function.
I want to be able to capture the match on the left and insert it back into the replacement pattern with $1 but nothing I've tried works. I know I'm missing something simple. Here's my latest iteration:
sed qr{("name": "$section",\n.*\n.*)}, '$1' . $json, $groups_file, multiline => TRUEBut this just inserts "$1" into the file before the $json. If I do:
$1$json
The $1 is empty. Presumably because it is replaced with '' during runtime.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Using a regex capture as part of a varible by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |