From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA01892; Sun, 5 Jan 2003 04:26:27 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA01885 for ; Sun, 5 Jan 2003 04:26:26 +0100 (MET) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h053QQ502837 for ; Sun, 5 Jan 2003 04:26:26 +0100 (MET) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto4.wanadoo.fr (6.7.015) id 3E0C33FD003C5296 for caml-list@inria.fr; Sun, 5 Jan 2003 04:26:26 +0100 Received: from warp (80.11.30.151) by mel-rta9.wanadoo.fr (6.7.015) id 3E075B460048EEF5 for caml-list@inria.fr; Sun, 5 Jan 2003 04:26:26 +0100 Message-ID: <000b01c2b46a$b2445170$971e0b50@warp> From: "Nicolas Cannasse" To: "OCaml" Subject: [Caml-list] Str Shortest Match Date: Sun, 5 Jan 2003 04:29:46 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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