From: Yutaka OIWA <oiwa@yl.is.s.u-tokyo.ac.jp>
To: caml-list@inria.fr
Subject: [Caml-list] [ann] Regexp library supporting binding for * and +'s
Date: Mon, 20 Sep 2004 05:41:04 +0900 [thread overview]
Message-ID: <vfiekkyrnz3.fsf@tuba.is.s.u-tokyo.ac.jp> (raw)
Hi everyone at caml-list,
From the computer room at ICFP2004 in Snowbird Resort,
I announce a beta version of my combinator-based
regular-expression match library which supports
list (Kleene-*) binding.
This library provide a set of typed "combinators" which can be
used to construct "regular expression matcher", which tests strings
against regexps and capture the matched substring in various ways.
Especially, powerful "repeat" combinator, which corresponds
to * and + operators in conventional regular expression notation,
returns all values captured inside as a list value.
For example, the small code below
open Regexp_pp_ng
let s = "1 2 3 4 5" in
match_string s (repeat ~sep:spacesA int_decimal) (fun x -> x)
returns [1; 2; 3; 4; 5]: int list.
All combinators are given static types and any mismatch of
value types and matcher types are statically rejected.
The implementation is available from a subversion repository.
Using subversion, you can checkout the URL
https://www.oiwa.jp/svn/regexp-ocaml/branches/combinators/
to get the up-to-date implementation, or you can directly
access the above address by web browsers to see the latest revision.
There is also a ViewCVS interface at the following address.
http://www.oiwa.jp/viewcvs/regexp-ocaml/branches/combinators/
See regexp_pp_ng.mli for interfaces, and regexp_pp_ng_test.ml for
some example of the use of this library.
It may work partially on some older OCaml, but for real use
it requires a newer version (3.07 or later) which supports
the relaxed value restriction.
I plan to construct a neat syntax sugar over this library
and build a next-generation version of Regexp/OCaml library.
Any comments are welcome.
--
Yutaka Oiwa Yonezawa Lab., Dept. of Computer Science,
Graduate School of Information Sci. & Tech., Univ. of Tokyo.
<oiwa@yl.is.s.u-tokyo.ac.jp>, <yutaka@oiwa.jp>
PGP fingerprint = C9 8D 5C B8 86 ED D8 07 EA 59 34 D8 F4 65 53 61
-------------------
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
next reply other threads:[~2004-09-19 20:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-19 20:41 Yutaka OIWA [this message]
2004-09-20 0:38 ` skaller
2004-09-20 6:54 ` Yutaka OIWA
2004-09-20 11:12 ` skaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vfiekkyrnz3.fsf@tuba.is.s.u-tokyo.ac.jp \
--to=oiwa@yl.is.s.u-tokyo.ac.jp \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox