From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 520C3BB81 for ; Wed, 22 Dec 2004 08:03:49 +0100 (CET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBM3nWvW008965 for ; Wed, 22 Dec 2004 04:49:33 +0100 Received: from [192.168.1.200] (ppp194-89.lns1.syd2.internode.on.net [203.122.194.89]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iBM3nUGa070232 for ; Wed, 22 Dec 2004 14:19:30 +1030 (CST) Subject: Str.string_match incorrect From: skaller Reply-To: skaller@users.sourceforge.net To: caml-list@yquem.inria.fr Content-Type: text/plain Organization: Message-Id: <1103687369.6979.50.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 22 Dec 2004 14:49:30 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41C8EECC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; sourceforge:01 bug:01 regexp:01 endline:01 regexp:01 glebe:01 061:98 nsw:01 partial:01 matched:01 prefixes:02 snail:02 2037:02 match:02 match:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: This looks like a fairly fundamental bug in Str module.. (so probably I'm missing something ..) This program: let m = Str.regexp "a";; let b = Str.string_match m "aa" 0;; print_endline (if b then "YES" else "NO");; prints YES. Clearly the string "aa" is NOT matched by the regexp "a". This *would be* the correct result for the Str.string_partial_match function which matches prefixes. However Str.string_match should match the whole string. [In bugtracker] -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net