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 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -