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

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

Re: string-match bug?


From: Andreas Röhler
Subject: Re: string-match bug?
Date: Wed, 09 Dec 2009 18:33:05 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

Juanma Barranquero wrote:
> On Wed, Dec 9, 2009 at 09:05, Andreas Röhler
> <address@hidden> wrote:
> 
>> Nonetheless, returning NIL at the second question looks like a more useful 
>> result -
> 
> Why?
> 
>> because taking incertitude.
> 
> Which incertitude? Matching the empty regexp against any string is
> always going to match.

But simply by convention, isn't it?

Aren't

(string-match "" "a")

and

(string-match "" "")

different cases in some perspective?

The return value is censured being a position.
Second case is plausible, there is an empty string at pos 0.

First has no empty string at pos 0.
Result is logically not plausible for me - even if I'm well able to live 
with... :)



> 
>     Juanma
> 







reply via email to

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