From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: Help with query-replace-regular expression Date: Mon, 11 Sep 2006 15:45:58 +0200 Organization: Organization?!? Message-ID: <85hczeh5yh.fsf@lola.goethe.zz> References: <1157980933.187942.311270@i42g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157985653 1920 80.91.229.2 (11 Sep 2006 14:40:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 14:40:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 11 16:40:51 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GMmxY-0003rx-Kd for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Sep 2006 16:40:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMmxY-0005pv-6Y for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Sep 2006 10:40:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed-east.nntpserver.com!nntpserver.com!statler.nntpserver.com!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:6Z1afE8PiDFxD+vl1Juo1oljCyE= Original-Lines: 25 Original-NNTP-Posting-Date: 11 Sep 2006 15:46:02 CEST Original-NNTP-Posting-Host: 020df940.newsspool4.arcor-online.net Original-X-Trace: DXC=G57noKBIQlVE47KDAk81NW4IUK\BH3YRX4; ; 4EPE3U\CV`H8_`hhQT^9QSCVg3dOVlR6Na List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37290 Archived-At: 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#*/// > > 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