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 D1452BB81 for ; Sat, 25 Dec 2004 04:07:05 +0100 (CET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBP37598018257 for ; Sat, 25 Dec 2004 04:07:05 +0100 Received: by wproxy.gmail.com with SMTP id 68so528774wri for ; Fri, 24 Dec 2004 19:07:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=nT6ySXtZJetWW0BUxGSqBOXjwpRL11ZixZuAgeNuLW5XF1uwrr3w/NRa7tg2n5u9a4l3c2S8dz0c/X5DwcqS5n4DvkpN8jlYZ57aUUj1lQTvDWBFVvDvQ8eqkh756Dz2+oufA+4IsJToMTWJc6cVDhqxYwqhQo+0JolC/vILUko= Received: by 10.54.33.47 with SMTP id g47mr58088wrg; Fri, 24 Dec 2004 19:07:04 -0800 (PST) Received: by 10.54.31.60 with HTTP; Fri, 24 Dec 2004 19:07:04 -0800 (PST) Message-ID: <8008871f041224190768113639@mail.gmail.com> Date: Fri, 24 Dec 2004 22:07:04 -0500 From: "Christopher A. Watford" Reply-To: "Christopher A. Watford" To: skaller@users.sourceforge.net Subject: Re: [Caml-list] Str.string_match incorrect Cc: David Brown , William Lovas , caml-list@yquem.inria.fr In-Reply-To: <1103936225.6201.243.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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> X-Miltered: at nez-perce with ID 41CCD959.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 wrote:01 regexp:01 pcre:01 regexp:01 bool:01 glebe:01 ...:98 061:98 nsw:01 partial:01 constraint:01 snail: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=RCVD_BY_IP autolearn=disabled version=3.0.0 X-Spam-Level: On 25 Dec 2004 11:57:05 +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 > > -- > 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 > > >>From the documentation, as you have pointed out (now I see what you mean), it does not make this constraint obvious. It appears that string_match's documentation should include that an implicit ^ is added. string_partial_match makes this clear however. -- Christopher A. Watford christopher.watford@gmail.com http://dorm.tunkeymicket.com