Please read the pcre man page on partial matching: "man pcrepartial". The reason why e.g. "hsgshsn" gives you a partial match is that it ends in "n", and the pattern starts with "n". This means that the subject string might match the pattern "node" if it were extended appropriately.
Regards, Markus On Thu, Dec 22, 2011 at 20:21, oliver <[email protected]> wrote: > > > Here is what I get in examples: > > > let _ = > > let pattern = "node" in > > let doc = "httpsdjshdjshdjnodeshdsden" in (* true *) > let doc = "skjdfjjeroiurt//lkj" in (* false *) > let doc = "skjdf" in (* false *) > let doc = "skjdfg" in (* false *) > let doc = "hsgshsn" in (* ~flags:[`PARTIAL] => > Fatal error: exception Pcre.Error(0) *) > let doc = "http:gggggggggggg//spnnden" in (* ~flags:[`PARTIAL] => > Fatal error: exception Pcre.Error(0) *) > > if Pcre.pmatch ~pat:pattern ~flags:[`PARTIAL] doc then print_endline "true" > else print_endline "false" > > > Rather looks like a true pcre-problem, not one of ocaml-pcre... ?! > > > > Ciao, > Oliver > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Markus Mottl http://www.ocaml.info [email protected] -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
