Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. coregex

coregex

MITGov0.12.30

A pure Go production-grade regex engine with SIMD optimizations, offering 3-3000x speedup over the standard library.

Visit WebsiteGitHubGitHub
270 stars7 forks0 contributors

What is coregex?

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.

Target Audience

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.

Value Proposition

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.

Overview

Pure Go production-grade regex engine with SIMD optimizations. Up to 3-3000x+ faster than stdlib.

Use Cases

Best For

  • Log analysis with complex pattern matching (e.g., extracting errors, IP addresses, or specific file extensions)
  • High-throughput text processing pipelines where regex performance is critical
  • Data validation tasks requiring fast email, URL, or pattern matching
  • Building AWK-like tools or interpreters that rely heavily on regex operations
  • Applications needing suffix pattern matching (e.g., file extension searches)
  • Multi-pattern search scenarios with 2-64 literal alternatives

Not Ideal For

  • Applications requiring regex backreferences for complex pattern matching (e.g., duplicate word detection)
  • Simple scripts or one-off tasks where stdlib regexp performance is adequate and stability is prioritized
  • Deployments on non-AMD64 architectures (e.g., ARM) where SIMD optimizations are unavailable
  • Production systems needing long-term API stability without breaking changes, due to its pre-1.0 status

Pros & Cons

Pros

Dramatic Performance Gains

Benchmarks show 3-3000x speedups over stdlib, with patterns like multiline searches up to 299x faster and inner literal optimizations reaching 881x improvements.

Multi-Engine Optimization

Automatically selects from 17 strategies including Lazy DFA and SIMD prefilters, ensuring optimal performance for diverse patterns like IP addresses or suffix searches.

Zero-Allocation APIs

Provides methods like IsMatch and FindIndices that avoid heap allocations, improving efficiency in tight loops and matching Rust's performance in some cases.

Drop-In Compatibility

Uses identical API signatures as regexp.Regexp, allowing seamless replacement with minimal code changes, as shown in the quick start example.

Cons

No Backreference Support

Deliberately omits backreferences to maintain O(n) guarantees, limiting use cases that rely on advanced regex features available in alternatives like regexp2.

Pre-Release Instability

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.

Architecture-Dependent Performance

SIMD optimizations require AMD64; on other architectures, performance gains may be reduced due to pure Go fallback, affecting speed on ARM or older CPUs.

Frequently Asked Questions

Quick Stats

Stars270
Forks7
Contributors0
Open Issues13
Last commit5 days ago
CreatedSince 2025

Tags

#dfa#high-performance#regex#simd#regex-engine#go-library#regexp#text-processing#aho-corasick#avx2#simd-optimization#nfa#golang#go#drop-in-replacement#performance

Built With

G
Go

Links & Resources

Website

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

rexrex

Flexible regular expressions constructor for Golang.

Stars213
Forks5
Last commit1 month ago
regroupregroup

Match regex group into go struct using struct tags and automatic parsing

Stars150
Forks13
Last commit2 years ago
go-wildcardgo-wildcard

🚀 Fast and light wildcard pattern matching.

Stars103
Forks8
Last commit4 months ago
goregengoregen

randexp for Go.

Stars92
Forks26
Last commit4 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub