A library for deterministic finite automata (DFA) regular expressions and lexical analysis tools.
libfsm is a library and toolset for deterministic finite automata (DFA) regular expressions and lexical analysis. It compiles regular expressions to deterministic FSMs, ensuring linear-time pattern matching for supported patterns. The project includes libraries for FSM manipulation and regex compilation, plus command-line tools for regex matching and lexer generation.
Developers and researchers working on text processing, compiler construction, or lexical analysis who need predictable linear-time regex matching without backtracking overhead.
libfsm offers guaranteed linear-time execution for supported regex patterns by using deterministic FSMs, avoiding the unpredictable performance of backtracking engines. Its lexer generator (lx) is simple, expressive, and language-independent, focusing solely on efficient lexing.
DFA regular expression library & friends
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
libfsm compiles regular expressions to deterministic FSMs, ensuring supported patterns run in linear time without backtracking, as highlighted in the README for predictable performance in text processing.
lx is designed to be simple, expressive, and language-independent, focusing solely on efficient lexing without extra features, making it ideal for compiler front-end development.
Includes command-line tools like re(1) for regex matching and lx(1) for lexer generation, plus libraries (libfsm, libre) for FSM and regex compilation, as detailed in the features list.
Uses deterministic finite automata for pattern matching, avoiding the complexity and unpredictability of backtracking engines, which is core to its philosophy for performance-critical applications.
Only supports patterns that compile to deterministic FSMs, missing common features like backreferences and lookahead, as noted in the README's advice on unsupported features.
Requires bmake for building, which isn't standard on all systems, and has dependencies like xmllint for tests and xsltproc for documentation, adding setup overhead.
As a niche library focused on FSM-based matching, it lacks the broad community support, bindings, and integrations found in mainstream regex libraries like PCRE or RE2.