[Top][All Lists]

[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 09:05:12 +0100
User-agent: Thunderbird (X11/20081227)

Matthew Dempsky wrote:
> On Tue, Dec 8, 2009 at 12:48 PM, Barry Margolin <address@hidden> wrote:
>> If
>> (string-match (concat regex1 regex2) (concat str1 str2))
>> then
>> (and (string-match regex1 str1) (string-match regex2 str2))
> Not quite: STRING-MATCH searches for a substring that matches a
> specified regexp; it doesn't return whether the whole string matches
> the regexp.

As said, present behavior is POSIX and I don't question that for now.
Nonetheless, returning NIL at the second question looks like a more useful 
result -
because taking incertitude.

(string-match "a" "a") => 0
(string-match "" "a") => 0
(string-match "" "") => 0

reply via email to

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