A RegexBuddy user told me that he couldn’t easily find a detailed explanation of the replacement text syntax supported by the
$1: Text matched by the first capturing group or the literal text $1 if the regex has no capturing groups.
$99: Text matched by the 99th capturing group if the regex has 99 or more groups. Text matched by the 9th capturing group followed by a literal 9 if the regex has 9 or more but less than 99 groups. The literal text $99 if the regex has fewer than 9 groups.
$+: Text matched by the highest-numbered capturing group. Replaced with nothing if the highest-numbered group didn’t participate in the match.
$&: Text matched by the entire regex. You cannot use
$`(backtick): Text to the left of the regex match.
$'(single quote): Text to the right of the regex match.
$_: The entire subject string.