regex - syntax for specifying matched digit string in Emacs replace-regexp? -
in emacs, i'm trying prepend instances of digits text string, every </a>1</h2>
become </a>chapter 1</h2>
, on.
i'm able find matches using regexp: </a>\([0-9]+\)
how specify existing matched digit in replacement string, rather entire string?
you've correctly used \(
, \)
enclose digits in capture group can write replacement string \1
(since first capture group) in regex. replacement string be
</a>chapter \1