Format Flags

ECMAScript format rules sed format rules Replacement text
$& & The character sequence that matched the entire regular expression ([match[0].first, match[0].second))
$$   ”$“
  \& ”&“
$`“ (dollar sign followed by back quote)   The character sequence that precedes the subsequence that matched the regular expression ([match.prefix().first, match.prefix().second))
$'“ (dollar sign followed by forward quote)   The character sequence that follows the subsequence that matched the regular expression ([match.suffix().first, match.suffix().second))
$n \n The character sequence that matched the nth (0 <= n <= 9) capture group ([match[n].first, match[n].second)
  \\n ”\n“
$nn   The character sequence that matched the nnth (10 <= nn <= 99) capture group ([match[nn].first, match[nn].second)