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 AE62BBB81 for ; Wed, 22 Dec 2004 09:30:10 +0100 (CET) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBM8U8UN027731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 22 Dec 2004 09:30:10 +0100 Received: (qmail 8752 invoked from network); 22 Dec 2004 08:30:07 -0000 Received: from dsl081-060-084.sfo1.dsl.speakeasy.net (HELO trout.darktech.org) (chrisrb@[64.81.60.84]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 22 Dec 2004 08:30:07 -0000 Received: by trout.darktech.org (sSMTP sendmail emulation); Wed, 22 Dec 2004 00:38:15 -0800 From: "Evan Martin" Date: Wed, 22 Dec 2004 00:38:15 -0800 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Str.string_match incorrect Message-ID: <20041222083815.GA81468@trout> References: <1103687369.6979.50.camel@pelican.wigram> <20041222074455.GA81342@trout> <20041222080009.GA4501@force.stwing.upenn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041222080009.GA4501@force.stwing.upenn.edu> User-Agent: Mutt/1.4.2.1i X-Sent-by-Evan: yep X-Miltered: at nez-perce with ID 41C93090.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; martine:01 caml-list:01 lovas:01 wrote:01 semantics:01 regexp:01 bool:01 regexp:01 bool:01 python's:01 martine:01 ...:98 partial:01 partial:01 emulate:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: On Wed, Dec 22, 2004 at 03:00:10AM -0500, William Lovas wrote: > I concur with your assessment, but i think you're characterization of the > semantics of string_partial_match is inaccurate: > > # Str.string_match (Str.regexp "ab") "a" 0;; > - : bool = false > # Str.string_partial_match (Str.regexp "ab") "a" 0;; > - : bool = true > # Str.string_match (Str.regexp ".*ab") "a" 0;; > - : bool = false > > ... unless of course, i've misunderstood you. I don't think there's a > simple transformation on regular expressions that allow you to emulate > string_partial_match's behavior using only string_match. (Does anyone > care to prove me wrong? :) No misunderstanding except for mine. You are correct. (I had assumed, without reading the docs, that the match/partial_match distinction would be like Python's match/search.) -- Evan Martin martine@danga.com http://neugierig.org