Pure OCaml regular expressions, with support for Perl and POSIX-style strings
Re is a regular expression library for OCaml written by Jerome Vouillon that supports multiple regex syntax styles including Perl-style, POSIX extended, Emacs-style, and shell-style file globbing patterns. The library is implemented entirely in pure OCaml and uses a lazy DFA (deterministic finite automaton) approach to perform pattern matching in linear time relative to the matched string's length. While pattern compilation is slower than backtracking-based libraries like PCRE, matching performance becomes extremely fast once a sufficient portion of the DFA is built, and the library avoids pathological cases that cause problems for backtracking implementations.