From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter =?utf-8?Q?M=C3=BCnster?= Newsgroups: gmane.emacs.help Subject: Re: string-match bug? Date: Tue, 8 Dec 2009 12:50:22 +0100 Message-ID: <20091208115022.GB8704@gaston.couberia.bzh> References: <4b1d1a48$0$278$14726298@news.sunsite.dk> <4b1d1e3d$0$276$14726298@news.sunsite.dk> <4B1D6773.3000509@easy-emacs.de> <4B1E2DA8.3090907@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1260273236 4905 80.91.229.12 (8 Dec 2009 11:53:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2009 11:53:56 +0000 (UTC) To: Emacs Users Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 08 12:53:48 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 1NHydV-0007TT-59 for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Dec 2009 12:53:45 +0100 Original-Received: from localhost ([127.0.0.1]:41393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHydU-0004lV-PO for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Dec 2009 06:53:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHyaN-0003BI-PS for help-gnu-emacs@gnu.org; Tue, 08 Dec 2009 06:50:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHyaI-00037l-Ar for help-gnu-emacs@gnu.org; Tue, 08 Dec 2009 06:50:30 -0500 Original-Received: from [199.232.76.173] (port=37834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHyaH-00037W-Rz for help-gnu-emacs@gnu.org; Tue, 08 Dec 2009 06:50:26 -0500 Original-Received: from smtp19.orange.fr ([80.12.242.17]:32679) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHyaH-0005dk-KB for help-gnu-emacs@gnu.org; Tue, 08 Dec 2009 06:50:25 -0500 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1907.orange.fr (SMTP Server) with ESMTP id AFD2E2000106 for ; Tue, 8 Dec 2009 12:50:23 +0100 (CET) Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1907.orange.fr (SMTP Server) with ESMTP id A1A1A20001EB for ; Tue, 8 Dec 2009 12:50:23 +0100 (CET) Original-Received: from gaston.couberia.bzh (ARennes-256-1-152-78.w86-195.abo.wanadoo.fr [86.195.39.78]) by mwinf1907.orange.fr (SMTP Server) with ESMTP id 697A32000106 for ; Tue, 8 Dec 2009 12:50:23 +0100 (CET) X-ME-UUID: 20091208115023432.697A32000106@mwinf1907.orange.fr Original-Received: by gaston.couberia.bzh (Postfix, from userid 1000) id E7CE330993; Tue, 8 Dec 2009 12:50:22 +0100 (CET) Mail-Followup-To: Emacs Users Content-Disposition: inline In-Reply-To: <4B1E2DA8.3090907@easy-emacs.de> User-Agent: Mutt/1.5.17 (2007-11-01) 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:70499 Archived-At: On Tue, Dec 08 2009, Andreas R=C3=B6hler wrote: > (string-match "" "fooxyzzybar") asks, if there is an empty string in st= ring. > If yes, report the starting point of the empty string. >=20 > Does string start with an empty string? IMHO not. Hello Andreas, IMHO yes. Because the concatenation "" + "f" + "" + "o" + "" + "o" + "" is the same as "foo". You are looking for this regexp: (string-match "^$" "foo") Here you get nil as expected. Cheers, Peter --=20 Contact information: http://pmrb.free.fr/contact/