module Kwregexp:sig
..end
I generally use Pcre
for regular expressions, but it's against
my policy to have this library depend on any 3rd-party libraries
whose absence might prevent its compilation. I also want to avoid
the complexities of conditional compilation.
So, the module is functorized to push the dependency on Pcre
into the app that needs this module.
To use it, just do:
module P = Kwregexp.Make (Pcre)
Alternatively, you can use it with OCaml's Str
library.
module P = Kwregexp.Make (Str)
val rex_of_glob : string -> string
rex_of_glob str
: convert the traditional Unix glob-pattern (see
glob (7)
) in str
to an equivalent regular expression.
The regexp should work with both Str
and Pcre
.
module type RegexpType =sig
..end
Make
.
module Str:sig
..end
module Make:
Pcre
or Str
.