caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Str.string_match incorrect
@ 2004-12-22  3:49 skaller
  2004-12-22  7:44 ` [Caml-list] " Evan Martin
  0 siblings, 1 reply; 15+ messages in thread
From: skaller @ 2004-12-22  3:49 UTC (permalink / raw)
  To: caml-list

This looks like a fairly fundamental bug in Str module..
(so probably I'm missing something ..) 

This program:

let m = Str.regexp "a";;
let b = Str.string_match m "aa" 0;;

print_endline (if b then "YES" else "NO");;

prints YES. Clearly the string "aa" is NOT matched by
the regexp "a".

This *would be* the correct result for the

Str.string_partial_match

function which matches prefixes. However Str.string_match
should match the whole string. [In bugtracker]

-- 
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




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-12-26  1:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-22  3:49 Str.string_match incorrect skaller
2004-12-22  7:44 ` [Caml-list] " Evan Martin
2004-12-22  8:00   ` William Lovas
2004-12-22  8:38     ` Evan Martin
2004-12-22 10:37     ` Gerd Stolpmann
2004-12-22 15:57     ` skaller
2004-12-22 16:58       ` David Brown
2004-12-23  2:33         ` skaller
2004-12-24 17:40           ` Christopher A. Watford
2004-12-25  0:57             ` skaller
2004-12-25  3:07               ` Christopher A. Watford
2004-12-25  4:24                 ` skaller
2004-12-26  1:14               ` William Lovas
2004-12-22 17:26       ` Kurt Welgehausen
2004-12-23  2:09         ` skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).