From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tyler Smith Newsgroups: gmane.emacs.help Subject: Re: How does one avoid matching \n when matching all but whitespace? Date: 08 Jul 2007 12:38:44 GMT Organization: Sedgeboy Inc. Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1183898432 14884 80.91.229.12 (8 Jul 2007 12:40:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 8 Jul 2007 12:40:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 08 14:40:31 2007 connect(): Connection refused 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 1I7W3z-0004Hy-Fm for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Jul 2007 14:40:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7W3z-0005MG-0D for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Jul 2007 08:40:31 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!news.aliant.net!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Lines: 26 Original-NNTP-Posting-Host: 142.177.153.104 Original-X-Complaints-To: abuse@aliant.net Original-Xref: shelby.stanford.edu gnu.emacs.help:149950 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:45539 Archived-At: On 2007-07-07, ld1976 wrote: > > Hello all. This is a rookie's question. > I am trying to a simple text regular expression replacement. > The text goes as follows (white spaces may change: > tcl_cmd bla > kuku > I want to change it to: > tcl_cmd bla > kuku.rev1 > When trying to use replace-regexp \(>[ ]+[^ ]+\) to \1.rev1 I get: > tcl_cmd bla > kuku > .rev1 > This is quiet different than using the \W+ with perl... You could do it (almost) the same way you'd do it in perl: '\(> +\w+\)' to '\1.rev1' You can also use '$' to explicitly signal the end of line, which is helpful if you have other incidences of '> ' that occur earlier in the line: '\(> +\w+\)$' to '\1.rev1' HTH, Tyler