Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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

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
    - 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:  FAQ:
To unsubscribe, mail  Archives: