From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Storing regular expressions somewhere.... Date: Wed, 23 Aug 2006 17:45:51 +0200 Organization: Chalmers University of Technology, Sweden Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1156351332 862 80.91.229.2 (23 Aug 2006 16:42:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Aug 2006 16:42:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 23 18:42:07 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 1GFvnL-0001ou-U4 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Aug 2006 18:41:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFvnL-0002AF-FG for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Aug 2006 12:41:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news.net.uni-c.dk!newsfeed.sunet.se!news01.sunet.se!129.16.222.141.MISMATCH!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: gamma02.me.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1156347951 346 129.16.50.72 (23 Aug 2006 15:45:51 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Wed, 23 Aug 2006 15:45:51 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:TSYalgrxB7bNj16xFSLq+jOyPPo= Original-Xref: shelby.stanford.edu gnu.emacs.help:141257 Original-To: help-gnu-emacs@gnu.org 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:36880 Archived-At: "Birju Prajapati" writes: > On 23/08/06, Birju Prajapati wrote: >> Hi all, >> Sometimes I need to do complicated replace-regexps. However, they >> can be prone to errors, so what I end up doing is an >> isearch-forward-regexp until I get the expression correct. Once it >> is correct, I write it down and then type it back into a >> replace-regexp command! Rather cumbersome....Is there some sort of >> isearch-forwared-replace-regexp command ? Or can I recall the >> previous regexp searched for in my isearch-forward-regexp? You can type `M-e' in isearch and then copy the string from there. (In Emacs 22 you can run query replace directly from isearch with `M-%'.) Also, if you set `query-replace-interactive' to non-nil, replacements will reuse the last search string automatically. > After digging around a bit, I found M-x regexp-builder. However, > this doesn't seem to understand predefined character classes such as > \s- and seems to have a different regexp syntax. Is this a bug or am > I doing something wrong? By default backslashes have to be doubled (like inside a Lisp string). Try (setq reb-re-syntax 'string) -- Johan Bockgård