help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with query-replace-regular expression


From: David Kastrup
Subject: Re: Help with query-replace-regular expression
Date: Mon, 11 Sep 2006 15:45:58 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

jade_lindquist@hotmail.com writes:

> I'm struggling with emacs' implementation of regexp. I'd certainly
> appreciate some pointers.
>
> I'd like to replace lines like: /*#midp1_0#*///<editor-fold>
>
> with:
>
> //#if midp1_0
>
> the phrase midp1_0 could be debug or some other alpha plus _ sequence
>
> Thus I've tried M-x query-tags-regexp:
> from:  \\/\\*\\#\\([a-zA-Z_]+\\).*
> to: //#if \\1

Good grief.  You are using string syntax and escape far too much.
Just replace
/\*#\([a-zA-Z]+\).*
with
//#if \1

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

[Prev in Thread] Current Thread [Next in Thread]