Regex From Text
Generate a regex pattern from a natural-language description. Heuristic engine covers ~30 common patterns (emails, URLs, phone numbers, dates, UUIDs, hex colors, etc.). Output chains into regex-tester and regex-visualize.
About Regex From Text
Describe what you want to match in plain English and get a working regular expression back. Type "find email addresses" or "extract phone numbers" and the heuristic engine recognises the request from a library of ~30 common patterns. The result is ready to paste into JavaScript, Python, grep, your editor — anywhere standard regex syntax works. Nothing leaves your browser.
- Category
- inspect
- Input
- Accepts: text/plain.
- Output
- Outputs: application/json.
- Cost
- Free, runs in your browser
- Memory
- low
Common uses
- Generate a regex without remembering the syntax — type the description, paste the result.
- Bootstrap a pattern when you know the target (URLs, dates, UUIDs) but not the exact characters.
- Teach regex by example — see how "match hex colors" becomes `#[0-9a-fA-F]{3,8}\b`.
- Quickly draft search-and-replace patterns for editor find dialogs.
- Compose into chains: from-text → visualize (see the diagram) → tester (try it on real input).
Frequently asked questions
Does this use AI?
No — the free version is a curated heuristic engine covering ~30 common patterns (emails, URLs, phones, dates, UUIDs, hex colors, IPv4/6, credit cards, SSNs, ZIPs, hashtags, semver, prices, timestamps, comments, file paths, emoji, more). It runs instantly, in your browser, with zero requests to any server.
What happens when my description does not match a known pattern?
The tool returns `confidence: "no-match"` along with an `upgrade` field pointing to the future AI fallback. You either revise the description or wait for the hosted-AI Pro tier.
Can I detect flags from natural language?
Yes — "case insensitive", "multiline", "first match only", "every match", "ignore case", "unicode" are all recognised and applied to the output flags.
Does the output work in every regex flavour?
The patterns use JavaScript regex syntax. The vast majority work as-is in Python (re), grep -E / -P, ripgrep, sed, and editor find dialogs. Lookbehind and named-group syntax can vary — visualize the result to spot anything flavour-specific.
Keywords
- regex
- regexp
- natural language
- pattern
- generate
- ai-assisted
- from text