[PLUG] emacs: regex replace modified search string

Rich Shepard rshepard at appl-ecosys.com
Fri Jun 26 14:48:10 UTC 2015


   In a text file > 2200 lines have this form:
 	,C...
that is. a comma followed by one or more characters. I want to replace that
with:
 	,'C...
by adding the quote between the comma and first character in the string.

   This search string works ,[A-Za-z] (and ,[:alpha:] would also work), but
I've not found the syntax for the replacement string while reading the emacs
wiki or emacs regex tutorial. those cover only regex for searches.

   Trying the string ,'\1 fails miserably. A pointer on how to replace the
original string with a single quote between the comma and first char is
needed.

Rich



More information about the PLUG mailing list