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 QAA01345; Tue, 7 Jan 2003 16:57:35 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA01382 for ; Tue, 7 Jan 2003 16:57:34 +0100 (MET) Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h07FvXr19166 for ; Tue, 7 Jan 2003 16:57:33 +0100 (MET) Received: from relay.rinet.ru (localhost [127.0.0.1]) by relay.rinet.ru (8.12.6/8.12.6) with ESMTP id h07FvUWU086937 for ; Tue, 7 Jan 2003 18:57:31 +0300 (MSK) (envelope-from dbely@mail.ru) Received: (from uucp@localhost) by relay.rinet.ru (8.12.6/8.12.6/Submit) with UUCP id h07FvUBJ086936 for caml-list@inria.fr; Tue, 7 Jan 2003 18:57:30 +0300 (MSK) Received: from dialin1.stormoff (ROVER1) [192.168.0.129] by stormoff with esmtp (Exim 3.12 #1 (Debian)) id 18VviC-00016D-00; Tue, 07 Jan 2003 18:32:18 +0300 X-Comment-To: "Nicolas Cannasse" To: caml-list@inria.fr Subject: Re: [Caml-list] Str Shortest Match References: <000b01c2b46a$b2445170$971e0b50@warp> From: Dmitry Bely Date: Tue, 07 Jan 2003 18:32:46 +0300 Message-ID: <4r8lgeld.fsf@mail.ru> User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Military Intelligence (RC5 Windows), i586-pc-win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Nicolas Cannasse" writes: > 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" Why not to use Pcre module then? - Dmitry Bely ------------------- 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