Skip to content

Plain English to regex · offline

Regex Generator

Describe what you want in plain English, or paste an example. You get three tested versions with explanations and code for the language selected in the top bar.
Try:

What the generator understands

The engine knows 300 hand-written templates across 11 categories: Numbers (28), Text (28), Dates (27), Codes (27), IDs (27), URLs (27), Social (27), Finance (27), Validation (27), Extraction (27), Custom Formats (28). It also recognises phrases like “5 digit”, “between 4 and 6 digits”, “starting with #”, “ending with .pdf”, “between [ ]” and quoted literal text, and it can compose patterns from descriptions such as “3 letters then dash then 4 digits”.

A generated pattern is a starting point. Test it on your real data in the Playground, compare it with the curated entries in the Pattern Library, and read Validation vs extraction to choose the right strictness.

Frequently asked questions

Is the generator an AI model?
No. It is a deterministic, offline intent engine. It normalises your words, matches them against a library of hand-written templates, extracts details such as digit counts and delimiters, infers shapes from examples, and composes a best-effort pattern when nothing else fits.
Why are there three versions of every pattern?
Loose finds more and may include near misses, Balanced is the sensible default for searching text, and Strict is the tightest shape, usually anchored to the whole input. Pick the one that fits whether you are extracting from messy text or validating a form field.
Are the examples real tests?
Yes. Every positive and negative example is run against the pattern in your browser when the card renders, and the tick or cross shows the actual result, so you can see exactly where a looser version lets something through.
Can I paste a sample instead of describing it?
Yes. If your description contains a sample such as 12-01-2026 or AB-1234, the generator infers the shape from character runs (digits, uppercase, lowercase and punctuation) and offers a pattern with exactly that structure.