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 RAA07776; Mon, 2 Aug 2004 17:01:14 +0200 (MET DST) 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 RAA07394 for ; Mon, 2 Aug 2004 17:01:13 +0200 (MET DST) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i72F1CEV023422 for ; Mon, 2 Aug 2004 17:01:13 +0200 X-Sasl-enc: z6XTmmWzSc9nISzDjqvP1A 1091458870 Received: from [192.168.1.100] (unknown [218.81.122.80]) by mail.messagingengine.com (Postfix) with ESMTP id DC8A7C13E4D for ; Mon, 2 Aug 2004 11:01:09 -0400 (EDT) Date: Mon, 2 Aug 2004 23:00:54 +0800 (HKT) From: Martin Jambon X-X-Sender: martin@localhost To: caml-list@inria.fr Subject: [Caml-list] Micmatch 0.666 (first release) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 410E5738.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; riders:01 regexps:01 endline:01 val:01 ocaml:01 caml:01 tar:01 match:02 jambon:02 jambon:02 unit:03 unit:03 string:03 string:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dear Caml riders, I would like to announce the first release of Micmatch. Micmatch is an extension of the pattern matching of OCaml for matching strings against regular expressions, following the style of ocamllex regexps. Here is an example of an interactive session: # RE digit = ['0'-'9'] ;; # RE letter = ['a'-'z' 'A'-'Z'] ;; # RE word = letter (letter | '_' | digit)* ;; # RE space = [' ' '\t' '\n' '\r'] ;; # let say_hello l text = match l, text with (_, RE _* "name" space* "=" space* (word as name) space* ";") | (name :: _, _) -> print_endline ("Hello " ^ name) | _ -> invalid_arg "say_hello" ;; val say_hello : string list -> string -> unit = # say_hello ["Joe"; "Jack"] "id=123; name=Martin; end";; Hello Martin - : unit = () # say_hello ["Joe"; "Jack"] "id=123; name= ; end";; Hello Joe - : unit = () Documentation can be found here: http://martin.jambon.free.fr/micmatch.html The package can be downloaded directly from here: http://martin.jambon.free.fr/micmatch.tar.gz Have fun! Martin ------------------- 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