> Hi Uwe, > 2014-08-09 21:15 GMT+02:00 Uwe Brauer <[email protected]>:
> If you want to replace all occurrences of the regexp, using a `while
> re-search-forward' + `replace-match' is a better idea. Your error is
> that you aren't specifying groups for the two arguments of the macro,
> so you can't use them in the replace text.
> The following should do the trick:
> (while (re-search-forward "\\\\nv{\\([^}]*\\)}{\\([^}]*\\)}" nil t)
> (replace-match "\\\\|\\1\\\\|_{H^{\\2}}"))
> but please note that it will automatically replace all occurrences of
> \nv{...}{...}, so I'd suggest to try it in a test buffer.
> `re-builder' is your friend when you want to build regexp ;-)
Thanks very much, usually since I am always worried about global
replacing I usually use query-replace and then when I am convinced I use
! To replace all.
Thanks also for pointing out re-builder.
Uwe
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ auctex-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex-devel
