Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Micmatch 0.666 (first release)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin_jambon@e...>
Subject: [Caml-list] Micmatch 0.666 (first release)
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 = <fun>
# 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