* [Caml-list] Str Shortest Match
@ 2003-01-05 4:29 Nicolas Cannasse
2003-01-07 15:32 ` Dmitry Bely
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Cannasse @ 2003-01-05 4:29 UTC (permalink / raw)
To: OCaml
Hi everyone,
Is there a way to do a shortest regular expression matching using Str ?
In Perl and many RE engines, this is done by using .*? but it does not
seems to work on Str.
let s = "yayybyyb" in
let r = Str.regexp "a\(.*?\)b" in
Str.search_forward r s 0;
Str.matched_group 1 s;
=> "yybyy" instead of "yy"
Nicolas Cannasse
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-07 15:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-05 4:29 [Caml-list] Str Shortest Match Nicolas Cannasse
2003-01-07 15:32 ` Dmitry Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox