Pattern Engineering Engine · @Regex-Gen-Tester
Regex-Gen-Tester
Generate regular expressions from plain English, run them live against your test samples in an edge isolate, and flag common catastrophic backtracking (ReDoS) risks.
What You Provide
A plain-English description of the pattern you need, accompanied by positive strings that should match and negative strings that must fail.
- Desired format rule (e.g. email, UUID, date)
- Positive examples (e.g.
user@domain.com) - Negative test cases (e.g.
invalid-email)
What You Receive
A production-ready regex literal, detailed breakdown explanation, execution table across your samples, and AST-based ReDoS safety analysis.
- Compiled pattern with required flags (e.g.
/i,/m) - Per-sample match status and captured group text
- Heuristic check for catastrophic backtracking
Copyable Starter Prompts
Copy and paste these templates into the bot to get started:
Match valid email addresses including subdomains and plus addressing.
Sample: user+tag@company.co.uk
Sample: invalid..address@test.com
RFC 5322 subset with capture group breakdown.
Match Indian mobile phone numbers with optional +91 or 0 prefix.
Sample: +91 98765 43210
Sample: 9876543210
Sample: 123456
Covers standard 10-digit mobile operators.
Match ISO 8601 UTC timestamp strings.
Sample: 2026-09-08T02:00:00Z
Sample: 2026-09-08
Captures Year, Month, Day, and Time tokens.
Verified Real Execution Output
Sample streamed response for an email pattern query:
### ⚡ Regex Execution Report
**Pattern**: `/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/i`
**ReDoS Risk**: Low (No exponential nested quantifiers detected)
#### 🔬 Real Execution Against Samples:
| Sample String | Status | Execution Time | Match Groups |
| :--- | :---: | :---: | :--- |
| `test@example.com` | ✅ Matched | 0ms | `test@example.com` |
| `invalid-email` | ❌ No Match | 0ms | *none* |
Limitations & Responsible Use
Regular expressions validate syntactic lexical formatting. A format match does not guarantee that an email mailbox exists, that a domain has active MX records, or that a telephone number is in service. Use application-layer DNS verification, SMTP handshakes, or SMS OTP verification for identity validation. The ReDoS checker flags known catastrophic patterns; always configure execution timeouts in backend runtimes.
Frequently Asked Questions
How does Apex Forge Regex test my patterns?
The bot compiles the regular expression inside a secure V8 isolate and executes it against your provided sample strings, reporting exact capture groups and execution timing.
What is catastrophic backtracking (ReDoS)?
Catastrophic backtracking occurs when nested quantifiers cause exponential evaluation steps on non-matching strings, freezing server CPUs. The tool uses AST analysis to flag unsafe patterns.
Does a regex match guarantee valid data?
No. Regular expressions validate syntactic format only. A valid email format does not verify mailbox delivery, and a valid credit card format does not verify account status.