A pure Go production-grade regex engine with SIMD optimizations, offering 3-3000x speedup over the standard library.
Coregex is a pure Go regular expression engine that provides a production-grade, high-performance alternative to Go's standard `regexp` package. It solves the performance limitations of the stdlib by incorporating a multi-engine architecture with SIMD optimizations, achieving speedups of 3-3000x on real-world patterns while maintaining API compatibility and O(n) time guarantees.
Go developers working on performance-critical applications that involve heavy text processing, log analysis, data validation, or pattern matching where regex performance is a bottleneck.
Developers choose Coregex for its dramatic performance improvements over the standard library, its drop-in API compatibility that requires minimal code changes, and its guarantee of linear time complexity which prevents ReDoS vulnerabilities. It brings state-of-the-art regex optimizations previously only available in languages like Rust to the Go ecosystem.
Pure Go production-grade regex engine with SIMD optimizations. Up to 3-3000x+ faster than stdlib.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show 3-3000x speedups over stdlib, with patterns like multiline searches up to 299x faster and inner literal optimizations reaching 881x improvements.
Automatically selects from 17 strategies including Lazy DFA and SIMD prefilters, ensuring optimal performance for diverse patterns like IP addresses or suffix searches.
Provides methods like IsMatch and FindIndices that avoid heap allocations, improving efficiency in tight loops and matching Rust's performance in some cases.
Uses identical API signatures as regexp.Regexp, allowing seamless replacement with minimal code changes, as shown in the quick start example.
Deliberately omits backreferences to maintain O(n) guarantees, limiting use cases that rely on advanced regex features available in alternatives like regexp2.
Marked as pre-1.0 with API changes possible, making it risky for production without careful versioning, as noted in the README's status section.
SIMD optimizations require AMD64; on other architectures, performance gains may be reduced due to pure Go fallback, affecting speed on ARM or older CPUs.