From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Trouble in understanding the behavior of search-backward-regexp Date: 7 Sep 2009 16:17:10 GMT Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252347888 25951 80.91.229.12 (7 Sep 2009 18:24:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Sep 2009 18:24:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 07 19:04:09 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 1MkhdP-0005yh-CN for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Sep 2009 19:04:07 +0200 Original-Received: from localhost ([127.0.0.1]:33551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MkhdO-00079d-NU for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Sep 2009 13:04:06 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-X-Trace: individual.net 8D1ZDpwn9lN9LzqFWT65OgUZwHz8f596dWuAJzESD34/uTqomY Cancel-Lock: sha1:E1G7LYYJS8j2OZVx+8mXQOB4vqk= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/0.9.9 (Linux) Original-Xref: news.stanford.edu gnu.emacs.help:172803 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:67946 Alain Cochard wrote: > Hello. The trouble concerns the regular expression > > [[:blank:]]+ > > for which I read that it matches any sequence of spaces and tabs. > > Let me start with search-forward-regexp, with which I have no problem. > Let us say I have the following sentence: > > foo bar > > with spaces and tabs between the two words > > If I put the cursor at the beginning and I use 'search-forward-regexp' > with this [[:blank:]]+, I end up with the cursor right on the 'b', > which is what I expect. > > Now, if I put the cursor at the end of that sentence and use > search-backward-regexp, again with [[:blank:]]+, I would expect to end > up on the second 'o' of 'foo'. Instead, I end up somewhere between > the two words, which is very mysterious to me (I have tried with > several combinations of emacs-version/distributions/hardware). it does so because a single space/tab also matches "[[:blank:]]+". and while emacs searches backwards, it looks forward for a matching string. so the first matching string it finds is the single space/tab directly before "bar". the cursor is then put at the beginning of this string. -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)