English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] RE: a regular expression library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-25 (17:19)
From: Jerome Vouillon <vouillon@s...>
Subject: [Caml-list] RE: a regular expression library


I've started to write a regular expression library.  It supports
several styles of regular expressions:
- Perl-style regular expressions;
- Posix extended regular expressions;
- Emacs-style regular expressions;
- Shell-style file globbing
It is also possible to build regular expressions by combining simpler
regular expressions.

The library is still under developpement, but already quite
usable.  The most notable missing features are back-references
and look-ahead/look-behind assertions.

I would greatly appreciate your comments about the library (and, in
particular, about its API).  Contributions and bug reports are also

The library can be downloaded from http://sourceforge.net/projects/libre/

The library seems to be pretty fast when compiled to native code.
Here are some timing results (Pentium III 500Mhz):
* Scanning a 1Mb string containing only 'a's, except for the last
  character which is a 'b', searching for the pattern "aa?b"
  (repeated 100 times).
    - RE: 2.6s
    - PCRE: 68s
* Regular expression example from http://www.bagley.org/~doug/shootout/
    - RE: 0.43s
    - PCRE: 3.68s
(The library is much slower when compiled to bytecode though, as it
 is entirely written in O'Caml.  I plan to rewrite the critical
 sections of the code in C.)

-- Jerome
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr