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: Regexp replacement Date: Sat, 28 Oct 2006 00:45:15 +0200 Organization: Organization?!? Message-ID: <85iri5nzt0.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1161992440 5823 80.91.229.2 (27 Oct 2006 23:40:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 Oct 2006 23:40:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 28 01:40:39 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 1GdbJQ-0005Rx-Bp for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Oct 2006 01:40:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GdbJO-0006IV-1a for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Oct 2006 19:40:30 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!news.germany.com!takemy.news.telefonica.de!telefonica.de!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:p7pol01GS4FtnpJm+dHgobYHlG0= Original-Lines: 13 Original-NNTP-Posting-Date: 28 Oct 2006 00:46:15 CEST Original-NNTP-Posting-Host: 3d2d67d0.newsspool3.arcor-online.net Original-X-Trace: DXC=FL83Fgha7[aJ00P1S40fZgMcF=Q^Z^V3h4Fo<]lROoRagUcjd<3m<; bB5MOK` 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:38343 Archived-At: Jim Dai writes: > I would like to delete \redtext{long text} with "long text" being kept. > I have any instances in a file, with "long text" varying that may include > other latex symbols like _ $. (assume there are not any {} pairs inside the > text. > > How can I use regexp replacement to achieve the desired changes? M-x query-replace-regexp RET \\redtext{\([^}]*\)} RET \1 RET -- David Kastrup, Kriemhildstr. 15, 44793 Bochum