[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-match bug?
From: |
Colin S. Miller |
Subject: |
Re: string-match bug? |
Date: |
Mon, 07 Dec 2009 15:08:38 +0000 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
Andreas Roehler wrote:
Hi,
is this a bug?
(string-match "" "foo") => 0
Andreas,
that is checking if the empty string can be found somewhere in the string "foo",
which always matches at offset 0.
If you want to check if "foo" IS the empty string then do
(string-match "^$" "foo")
HTH,
Colin S. Miller
--
Replace the obvious in my email address with the first three letters of the
hostname to reply.
- string-match bug?, Andreas Roehler, 2009/12/07
- Re: string-match bug?,
Colin S. Miller <=
- 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, 2009/12/14
- Message not available
- Re: string-match bug?, Barry Margolin, 2009/12/07
- Re: string-match bug?, Andreas Röhler, 2009/12/08