I think the best way to explain what I'm trying to do is using an example. Suppose one would want to replace all underlined words with italic ones in org-mode using a regular expression:
_example_ --> /example/
Using Perl regex, one could easily accomplish such a task with the grouping variables $1
, $2
, etc... using the expression s/_([^_]+)_/\/$1\//g
for this case.
Are there similar "grouping variables" in Emacs? If not, then what is the most efficient way to perform such a replacement operation?
C-h i
. Help yourself.i
is your friend in a manual (but yes, you need to guess which manual).