Version française
Home     About     Download     Resources     Contact us    
Browse thread
Str.string_match incorrect
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Str.string_match incorrect
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