English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2004-12-22 (07:03)
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


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