From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: harven Newsgroups: gmane.emacs.help Subject: Re: regexp/emacs selective replace Date: Wed, 25 Nov 2009 13:24:57 +0100 Organization: http://groups.google.com Message-ID: <871vjmyep2.fsf@ergodik.univ-brest.fr> References: <26478209.post@talk.nabble.com> <87skc3kokg.fsf@ergodik.univ-brest.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259152985 20570 80.91.229.12 (25 Nov 2009 12:43:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2009 12:43:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 25 13:42:59 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NDHCz-0004fN-52 for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 13:42:57 +0100 Original-Received: from localhost ([127.0.0.1]:41768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDHCy-0001ag-OS for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 07:42:56 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!goblin2!goblin.stu.neva.ru!feeder.erje.net!news.ecp.fr!crihan.fr!news.univ-brest.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-NNTP-Posting-Host: mathw171.univ-brest.fr Original-X-Trace: news.univ-brest.fr 1259152018 7022 172.19.130.171 (25 Nov 2009 12:26:58 GMT) Original-X-Complaints-To: usenet@news.univ-brest.fr Original-NNTP-Posting-Date: 25 Nov 2009 12:26:58 GMT User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:6WIhEiB8F32/GUq43zmnr4vZVG8= Original-Xref: news.stanford.edu gnu.emacs.help:175043 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:70116 Archived-At: m121212 writes: > Thanks for your repsonses! The solution for me in the end was just to record > a keyboard macro. Do you use a particular guide for regexps? Also, could > you explain this part: {[^}]*} *$ RET ? {[^}]*} *$ means { first an opening brace, [^}]* then any number of characters that are not a closing brace } then a closing brace, * any number of spaces, $ and the line ends there RET RETURN to proceed This matches {xxx} but not {xxx} \end{center} because the line does not end after the brace. See http://www.emacswiki.org/emacs/RegularExpression