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-25 (03:07) |
From: | Christopher A. Watford <christopher.watford@g...> |
Subject: | Re: [Caml-list] Str.string_match incorrect |
On 25 Dec 2004 11:57:05 +1100, skaller <skaller@users.sourceforge.net> 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