caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jerome Vouillon <jerome.vouillon@inria.fr>
To: Francois Rouaix <frouaix@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Regexp libraries
Date: Wed, 13 Feb 2002 15:23:06 +0100	[thread overview]
Message-ID: <20020213152306.B32322@pauillac.inria.fr> (raw)
In-Reply-To: <000001c1b211$5d469720$ca01a8c0@homebox>; from frouaix@yahoo.com on Sun, Feb 10, 2002 at 01:00:18AM -0800

On Sun, Feb 10, 2002 at 01:00:18AM -0800, Francois Rouaix wrote:
> I'm cleaning up some old code of mine that uses regexps quite heavily...
> Since those days where we only had Str, it seems that I now have the
> choice between at least Pcre and Libre. Would anyone care to give their
> opinion on those ? I'd like to get rid of Str because of the threads
> issues (and bugs with large input). I've used Pcre a bit, but would like
> to go to an all-Ocaml solution because of Win2k porting requirements.
> However, the Libre documentation is inexistant (the .mli files contains
> barely more than the types).

Here is a list of disavantages and advantages of RE compared to Pcre.

Disavantages
- The pattern compilation is more costly
- Not fully thread safe (you cannot simultaneously use the same
  pattern in different threads)
- Slower than Pcre when compiled to bytecode
- Lot of missing features : back-references, look-ahead and
  look-behind assertions, ...

Avantages
- Choice between different matching semantics
  (first match, longuest match, shortest match)
- Regular expression can be combined using operators such as union or
  concatenation
- Much faster than Pcre once start-up time is amortized
- All regular expression are executed at the same speed once start-up
  time is amortized, so you don't have to do any performance tweaking.

> Would somebody on the list, that has knowledge of the library (Jerome
> ?), be willing to enhance the Libre docs a tiny bit ?

I should really take the time to write a documentation.  But I don't
have the time at the moment...

Patrick Doane has contributed a pretty large test suite (located in
tests/test_*.ml).  This test suite may help you understand the library.

-- 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


      parent reply	other threads:[~2002-02-13 21:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-10  9:00 Francois Rouaix
2002-02-11  1:49 ` Markus Mottl
2002-02-13 14:23 ` Jerome Vouillon [this message]

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=20020213152306.B32322@pauillac.inria.fr \
    --to=jerome.vouillon@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=frouaix@yahoo.com \
    /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;
as well as URLs for NNTP newsgroup(s).