help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string-match bug?


From: Peter Münster
Subject: Re: string-match bug?
Date: Tue, 8 Dec 2009 12:50:22 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

On Tue, Dec 08 2009, Andreas Röhler wrote:

> (string-match "" "fooxyzzybar") asks, if there is an empty string in string.
> If yes, report the starting point of the empty string.
> 
> Does string start with an empty string? IMHO not.

Hello Andreas,

IMHO yes. Because the concatenation "" + "f" + "" + "o" + "" + "o" + ""
is the same as "foo".

You are looking for this regexp:  (string-match "^$" "foo")
Here you get nil as expected.

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]