Browse thread
Str.string_match incorrect
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2004-12-22 (08:30) |
From: | Evan Martin <martine@d...> |
Subject: | Re: [Caml-list] Str.string_match incorrect |
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