From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: string-match bug? Date: Mon, 07 Dec 2009 21:37:07 +0100 Message-ID: <4B1D6773.3000509@easy-emacs.de> References: <4b1d1a48$0$278$14726298@news.sunsite.dk> <4b1d1e3d$0$276$14726298@news.sunsite.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1260219487 27634 80.91.229.12 (7 Dec 2009 20:58:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 20:58:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Colin S. Miller" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 07 21:58:00 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHkeE-0004wp-F0 for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 21:57:34 +0100 Original-Received: from localhost ([127.0.0.1]:35210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHkeE-0002z9-7g for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 15:57:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHkKm-0002y5-JA for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 15:37:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHkKh-0002ux-PO for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 15:37:28 -0500 Original-Received: from [199.232.76.173] (port=46515 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHkKh-0002us-KB for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 15:37:23 -0500 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:62407) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHkKd-0001SA-Ui for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 15:37:21 -0500 Original-Received: from [192.168.178.27] (p54BE99C0.dip0.t-ipconnect.de [84.190.153.192]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Luaps-1OHNQU1wCO-00zd5Q; Mon, 07 Dec 2009 21:37:19 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <4b1d1e3d$0$276$14726298@news.sunsite.dk> X-Provags-ID: V01U2FsdGVkX1+nURSHhGQnTKPYQqnebIiiUJEYXqBE5GPdJ1x BgZkI/J6Pp+/OoDxPYneOuoR5NVN7crL9XAtZ9UeJLBqf/44xz u3nWO3yG1t6pOaA5sQKvcSVujro9iULDf7Pkk1+vKE= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70485 Archived-At: Colin S. Miller wrote: > Colin S. Miller wrote: >> >> If you want to check if "foo" IS the empty string then do >> (string-match "^$" "foo") >> > Or, of course, use (equal "" "foo"). > Don't use (eq ...), it checks if the string-object > is the same, not that they have the same value. > > Hi, thanks for your answer. Let me pose the question again: string-match asks, if a regexp is contained by string. (equal "" "foo") reads a quite different question for me, as (string-match "^$" "foo") does. Why should questioned string respond here it contains an empty string at position 0? Makes no sense for me. Andreas