From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 04970BB91 for ; Sun, 26 Dec 2004 02:14:48 +0100 (CET) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBQ1Eke7024488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sun, 26 Dec 2004 02:14:47 +0100 Received: from force.stwing.upenn.edu (force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id iBQ1EjHA020678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 25 Dec 2004 20:14:45 -0500 (EST) Received: from force.stwing.upenn.edu (localhost [127.0.0.1]) by force.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id iBQ1Eih4027931 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 25 Dec 2004 20:14:44 -0500 (EST) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.12.10/8.12.9/Submit) id iBQ1EiM2027894 for caml-list@yquem.inria.fr; Sat, 25 Dec 2004 20:14:44 -0500 (EST) Date: Sat, 25 Dec 2004 20:14:44 -0500 From: William Lovas To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Str.string_match incorrect Message-ID: <20041226011443.GA24706@force.stwing.upenn.edu> Mail-Followup-To: caml-list@yquem.inria.fr References: <1103687369.6979.50.camel@pelican.wigram> <20041222074455.GA81342@trout> <20041222080009.GA4501@force.stwing.upenn.edu> <1103731044.6979.109.camel@pelican.wigram> <20041222165846.GA30503@old.davidb.org> <1103769192.3443.51.camel@pelican.wigram> <8008871f04122409405d1b9679@mail.gmail.com> <1103936225.6201.243.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1103936225.6201.243.camel@pelican.wigram> User-Agent: Mutt/1.5.4i X-Miltered: at nez-perce with ID 41CE1086.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 upenn:01 caml-list:01 wrote:01 wrote:01 regexp:01 pcre:01 regexp:01 bool:01 bug:01 25,:98 ...:98 expression:01 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: On Sat, Dec 25, 2004 at 11:57:05AM +1100, skaller wrote: > On Sat, 2004-12-25 at 04:40, Christopher A. Watford wrote: > > > Going by PCRE's documentation > > no idea why I would do that ... > > > Str.string_match (Str.regexp "a") "ab" 0 ;; > > > > And in PCRE /a/ matches "ab" or "aa" or "ba". > > # Str.string_match (Str.regexp "a") "xax" 0;; > - : bool = false *That* i would call a bug. I think that of Str.string_match (Str.regexp "a") "xa" 0;; Str.string_match (Str.regexp "a") "ax" 0;; either both should evaluate to true, or neither should. Both evaluating to true would match the typical perl/grep/etc. notion of searching anywhere inside a string to for a matching substring, whereas neither doing so would correspond to the mathematical notion of containment in the language of a regular expression. William