Regex Dialect Transpiler & Compatibility Matrix
Transpile complex regular expressions between PCRE, Go RE2, JavaScript, Python, and Rust. Detect lookaround errors, convert possessive & atomic groups, and verify ReDoS linear-time safety.
5-Engine Cross-Dialect Compatibility Matrix
Real-time evaluation of syntax support, time complexity, and AST transformations across all major regex engines.
Syntax Diagnostics & Engine Advisories
No syntax warnings or incompatibility issues found.
Why Go RE2 & Rust Eliminate ReDoS Entirely
Traditional regex engines (PCRE, JS, Python) use recursive backtracking, making them vulnerable to Regular Expression Denial of Service (ReDoS). Go RE2 and Rust use deterministic finite automata (DFA/NFA) with guaranteed linear execution time.
Zero Catastrophic Backtracking
RE2 guarantees execution in time proportional to the length of the input text O(N), completely eliminating CPU freeze vulnerabilities.
Predictable Microsecond Latency
Whether the input text is 10 bytes or 10 megabytes, RE2 matches in strict linear passes without unbounded stack memory usage.
Untrusted User Input Safe
You can safely allow end users to supply custom regex search filters in Kubernetes, Envoy, and cloud microservices without risking server outage.
Standardized Named Groups
Uses Go standard syntax (?P<name>...) matching Python and Rust conventions.
Regex Engine Feature & Complexity Comparison
| Feature / Capability | PCRE / PHP | Go RE2 | JavaScript | Python re | Rust regex |
|---|---|---|---|---|---|
Lookahead (?=...) |
✓ Supported | ⛔ Forbidden (ReDoS risk) | ✓ Supported | ✓ Supported | ⛔ Forbidden |
Lookbehind (?<=...) |
✓ Supported | ⛔ Forbidden | ✓ Supported | ✓ Fixed-width | ⛔ Forbidden |
Backreferences \1 |
✓ Supported | ⛔ Forbidden (NP-complete) | ✓ Supported | ✓ Supported | ⛔ Forbidden |
| Named Groups | (?P<n>..) or (?<n>..) |
(?P<n>..) |
(?<n>..) |
(?P<n>..) |
(?P<n>..) |
Atomic Groups (?>...) |
✓ Native | ➔ (?:...) non-capturing |
➔ (?:...) |
➔ (?:...) |
➔ (?:...) |
Possessive Quantifiers *+, ++ |
✓ Native | ➔ *, + greedy |
➔ *, + |
➔ *, + |
➔ *, + |
Recursion (?R) |
✓ Native | ⛔ Unsupported | ⛔ Unsupported | ⛔ Unsupported | ⛔ Unsupported |
| Time Complexity | \(O(2^N)\) Exponential worst-case | \(O(N)\) Guaranteed Linear | \(O(2^N)\) Exponential worst-case | \(O(2^N)\) Exponential worst-case | \(O(N)\) Guaranteed Linear |
Frequently Asked Questions
Why does Go RE2 reject lookahead (?=...) and lookbehind (?<=...)?
Lookaround assertions require backtracking to verify conditions ahead or behind without consuming characters. To mathematically guarantee linear O(N) runtime and prevent ReDoS attacks, RE2 strictly forbids all lookaround syntax.
Why are backreferences forbidden in RE2?
Matching regular expressions with backreferences (like \1 or \k<name>) is proven to be NP-complete, requiring exponential worst-case time in backtracking engines. RE2 disallows backreferences to maintain strict linear performance.
How does the transpiler handle atomic groups (?>...) and possessive quantifiers ++?
Atomic groups and possessive quantifiers exist in PCRE to suppress backtracking. Since RE2 never backtracks by default, atomic groups are converted into non-capturing groups (?:...), and possessive quantifiers (++) are simplified to standard greedy quantifiers (+).
Is regex transpilation and test matching performed securely?
Yes! 100% of the transpilation, AST parsing, matrix evaluation, and live regex matching runs entirely in your browser using client-side JavaScript. No regex patterns or test strings are sent to our servers.