[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-match bug?
From: |
David Kastrup |
Subject: |
Re: string-match bug? |
Date: |
Mon, 14 Dec 2009 14:53:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> Matthew Dempsky wrote:
>> On Mon, Dec 7, 2009 at 12:37 PM, Andreas Röhler
>> <andreas.roehler@easy-emacs.de> wrote:
>>> Why should questioned string respond here it contains an empty string at
>>> position 0?
>>> Makes no sense for me.
>>
>> Here's an analogy: (string-match "xyzzy" "fooxyzzybar") returns 3.
>> This is because the first 5 characters starting at position 3 are
>> "xyzzy", the same as the first string parameter. The significance of
>> 5 here is the length of "xyzzy".
>>
>
> Well, string-match should tell first point of occurrence if any.
> If we have none, as with slightly changed example
>
> (string-match "xyzzy" "foox-a-yzzybar")
> it duly returns "nil" - and not "0" saying falsly "first point of
> non-occurence"
>
>
> (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.
(concat "" "fooxyzzybar") -> "fooxyzzybar", so obviously the empty
string starts of the resulting string "fooxyzzybar".
--
David Kastrup
- string-match bug?, Andreas Roehler, 2009/12/07
- Re: string-match bug?, Colin S. Miller, 2009/12/07
- Re: string-match bug?, Colin S. Miller, 2009/12/07
- Re: string-match bug?, Andreas Röhler, 2009/12/07
- Re: string-match bug?, Matthew Dempsky, 2009/12/07
- Re: string-match bug?, Andreas Röhler, 2009/12/08
- Re: string-match bug?, Juanma Barranquero, 2009/12/08
- Re: string-match bug?, Peter Münster, 2009/12/08
- Message not available
- Re: string-match bug?, Stefan Monnier, 2009/12/08
- Message not available
- Re: string-match bug?,
David Kastrup <=
- Message not available
- Re: string-match bug?, Barry Margolin, 2009/12/07
- Re: string-match bug?, Andreas Röhler, 2009/12/08
- Re: string-match bug?, Peter Dyballa, 2009/12/08
- Re: string-match bug?, Andreas Röhler, 2009/12/08
- Message not available
- Re: string-match bug?, Barry Margolin, 2009/12/08
- Re: string-match bug?, Pascal J. Bourguignon, 2009/12/08
- Re: string-match bug?, Stefan Monnier, 2009/12/09
- Re: string-match bug?, Matthew Dempsky, 2009/12/08
- Re: string-match bug?, Andreas Röhler, 2009/12/09
- Re: string-match bug?, Juanma Barranquero, 2009/12/09