libfsm is a C library and toolchain for constructing, manipulating, and compiling finite state machines (FSMs) from regular expressions. It supports multiple regex dialects (PCRE, glob, SQL LIKE, literal, native) and compiles them into deterministic finite automata (DFAs) that guarantee linear-time matching. The library provides a rich set of FSM operations: determinisation, minimisation, union, intersection, complement, reversal, trimming, and more. It also includes a lexer generator (lx) that produces C lexers from specification files, and a pattern matcher builder (rx) that merges many patterns into a single DFA with conflict detection. The architecture is modular: an abstract data type (ADT) layer provides reusable data structures (sets, hash tables, priority queues, edge sets, interned state sets); the libfsm core implements FSM algorithms; libre handles regex parsing and AST analysis; and multiple code generation backends emit C, Rust, Go, LLVM IR, x86 assembly, awk, shell, JSON, and a custom VM bytecode. The build system uses BSD make (bmake) and the project is extensively tested with unit tests, property-based fuzzing (theft), and a cross-implementation test runner (retest) that compiles and runs generated code via dlopen. Key entry points include the fsm CLI tool for interactive FSM operations, the re CLI for regex compilation and code generation, the lx CLI for lexer generation, and the rx CLI for building pattern matchers. The library is designed for embedding in other applications, with allocator hooks and a clean public API. It is particularly suited for high-performance pattern matching, protocol parsing, and any domain requiring deterministic automata with guaranteed worst-case performance.
hyperscan-java provides Java bindings for Vectorscan, a high-performance multiple regex matching library (fork of Intel's Hyperscan). It allows simultaneous matching of thousands of regular expressions against input streams with exceptional throughput. The library offers two usage modes: a direct Vectorscan API for maximum performance (with limited regex syntax) and a PatternFilter utility that combines Vectorscan pre-filtering with Java's full regex engine for complete PCRE support. Key features include UTF-8 handling with byte-to-character mapping, database serialization for avoiding recompilation, callback-based scanning for efficient match processing, and support for both string and byte-oriented scanning. The architecture is a clean wrapper around the native library via JavaCPP, with well-separated concerns: Expression (pattern definition), Database (compiled pattern set), Scanner (matching engine), and utility classes. The codebase demonstrates strong engineering practices with comprehensive test coverage, including regression tests for upstream bugs and a JMH benchmark. It is actively maintained with recent releases and CI across Linux and macOS (x86_64 and arm64).
Quamina is a high-performance Go library for matching patterns against JSON events. It uses a custom NFA/DFA automaton approach internally, supporting exact strings, shell-style wildcards, and a subset of I-Regexp (RFC 9485). Patterns are defined as JSON objects with field/value constraints, and the library provides a concise API to add patterns and efficiently retrieve matches for events. The core is a compact `smallTable` data structure for byte-transition tables, with optimizations like incremental epsilon closures and table-pointer deduplication to keep matching near O(1) for exact patterns. Quamina is version 2.0.1, has zero runtime dependencies, and includes extensive benchmarks and a research subdirectory for performance analysis. It is intended as an embedded library for real-time event classification (e.g., routing, log analysis) rather than a standalone service.