GNU bug report logs - #7267
23.1; regexp backslash-B matches word

Previous Next

Package: emacs;

Reported by: "Thibault Kruse" <thibault.kruse <at> gmx.de>

Date: Fri, 22 Oct 2010 18:52:02 UTC

Severity: normal

Found in version 23.1

Done: "Thibault Kruse" <thibault.kruse <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 7267-done <at> debbugs.gnu.org (full text, mbox):

From: "Thibault Kruse" <thibault.kruse <at> gmx.de>
To: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#7267: 23.1; regexp backslash-B matches word
Date: Sat, 23 Oct 2010 11:00:44 +0200
sorry, I misunderstood. But I now understand it means it always returns t except for the noted cases, as any string contains the empty string.

-------- Original-Nachricht --------
> Datum: Fri, 22 Oct 2010 22:49:27 -0400
> Von: Glenn Morris <rgm <at> gnu.org>
> An: "Thibault Kruse" <thibault.kruse <at> gmx.de>
> CC: 7267 <at> debbugs.gnu.org
> Betreff: Re: bug#7267: 23.1; regexp backslash-B matches word

> "Thibault Kruse" wrote:
> 
> > According to emacs manual, \B matches the empty string, but it does not.
> 
> The elisp manual says:
> 
> Backslash Constructs in Regular Expressions
> [...]
> 
> `\B'
>      matches the empty string, but _not_ at the beginning or end of a
>      word, nor at the beginning or end of the buffer (or string).
> 
> > start emacs with emacs -q --no-site-file
> > move point over word in the splash screen.
> > M-:
> > (looking-at "\\B")
> > minibuffer says: T, should say nil
> 
> Why do you think it should return nil?
> 
> This construct matches the empty string inside words.
> It only returns nil at word boundaries. Try
> 
> (looking-at "\\B")
> 
> with point at the start, middle, and end of a word.
> It returns nil, t, nil, as it should.
> 
> The empty string is _empty_, ie length zero, not whitespace or
> anything like that.
> 

-- 
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome




This bug report was last modified 14 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.