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] Some sugar for regexp matching using camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michel Schinz <Michel.Schinz@e...>
Subject: Re: [Caml-list] Some sugar for regexp matching using camlp4
Francois Pottier <> writes:

> Hello all,


> This is of course pretty modest, but it seems that, with a small
> number of such constructs, O'Caml could be turned into a rather nice
> textual manipulation language. (Something often requested on this
> list.) Opinions and further suggestions are welcome.

You might want to look at scsh[1] (my standard suggestion for this
list, it seems). The construct you implemented also exists in scsh,
under the name "let-match" (see page 134 of the scsh manual [2]). Many
other constructs are supported, like "if-match" (similar to let-match
but with a clause to be evaluated when the regular expression does not
match), "match-cond" (tries several regular expressions until one
matches) and so on.

Also very interesting in scsh is the sexp-based notation for regular
expressions (pages 112-... of [2]).


Bug reports:  FAQ:
To unsubscribe, mail  Archives: