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] ANNOUNCE: mod_caml 1.0.6 - includes security patch
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-01-19 (14:43)
From: Luc Maranget <luc.maranget@i...>
Subject: Re: [Caml-list] ANNOUNCE: mod_caml 1.0.6 - includes security patch
> On Mon, Jan 19, 2004 at 11:13:53AM +0100, Luc Maranget wrote:
> > I am not exactly sure I understand your needs. But you should probably have a
> > look at ocamllex.
> Coming from a Perl background, ocamllex is a very heavyweight solution
> for the simple problem of doing quick string matches.  The
> Regexp/OCaml package looks very good indeed - shame it can't be part
> of the standard syntax!
> Rich.
> -- 
> Richard Jones.
> Merjis Ltd. - improving website return on investment
> PTHRLIB is a library for writing small, efficient and fast servers in C.
> HTTP, CGI, DBI, lightweight threads:

Normally, using camlp4 you can insert regexp matchings
in ``standard'' syntax. Although the current manual of
camlp4 does not tell much about that.
Furthermore the code is at the moment broken in the CVS tree...

To me, the extra burden of having to preprocess the lexer
source is not that heavy in a big program, where you have Makefiles
anyway.  Besides some expressivity bonuses (but beware, such
expressivity often comes with fuzziness) one advantage of the library
approach is the possibility to give regexps dynamically (eg by reading external
files).  Few applications  take advantage of this.

Of course all my nice reasoning fails when you consider ``scripting'',
but even then, the idea of putting regexps in strings leads to unncessary
complications (ie many backslashes).
A more convenient way would be by some regexp data type either
abstract or concrete.
Such an API should probably be added to supported ocaml regexp packages.


-- Luc

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: