Module Glob


module Glob: sig  end
Wildcard matching


This module implements shell-like wildcard matching. The wildcards it understands:

These are pretty close to what POSIX wants. It doesn't have named character classes ([[:alpha:]]). I'm still trying to decide if they're worth the bother.

For anything more complicated, you'll need full regular expressions. I like PCRE, myself.


type t

The type of compiled patterns.

val compile : ?cs:bool -> string -> t
Compile a pattern for matching.

cs : True if the pattern is case-senstive, false for a case-insensitive pattern. Defaults to case-sensitive.
val exec : t -> string -> bool
Match a compiled pattern against a string
val quick : ?cs:bool -> string -> string -> bool
quick pattern against does a one-shot match

cs : True if the pattern is case-senstive, false for a case-insensitive pattern. Defaults to case-sensitive.
val case_sensitive : t -> bool
Returns the case-sensisitiveness of a pattern.
val escape : string -> string
Returns the string with any special wildcard characters escaped.