← All repos

ocaml-re

Pure OCaml regular expressions, with support for Perl and POSIX-style strings

dfaocamlregular-expression
Browse cluster: OCaml Systems and Utilities
934commits
53contributors
4languages

Tech stack & purpose

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.

Languages

OCaml
98.7%
Nix
0.9%
Dune
0.3%
Makefile
0.1%

Contributors (top 30 of 53)