← All Tools
Regex Builder Generator🔒 100% local
Visual regex pattern builder. Privacy-first, no server uploads, no tracking.
Related Tools
Turns a short description into a ready regular expression. Your phrase is matched against ten built-in patterns - email, HTTP URL, US phone, ISO date, IPv4, UUID v4, hex colour, strong password, URL slug and whitespace - and the page prints the pattern, a component-by-component explanation, the pattern's own sample strings run through a live RegExp with pass or fail marks, and JS and Python forms of the same pattern.
How to use it
- Describe what you want to match, for example 'email validation' or 'phone US'.
- Press Process.
- Read the pattern and the component lines, check the sample results marked with ticks and crosses, then Copy Output to take the block with you.
Worked example
email validationbecomes=== Email address ===
/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/
Component by component:
^[A-Za-z0-9._%+-]+ local part: letters, digits, dot, _ % + -
@ literal at sign
[A-Za-z0-9.-]+ domain labels
\\.[A-Za-z]{2,}$ a dot then a 2+ letter TLD
Verified against samples:
✓ "[email protected]" should match
✓ "[email protected]"should match
✓ "no-at-sign.com" should NOT match
✓ "a@b" should NOT match
Use it:
JS: const re = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
Python: re.match(r"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$", value)
Caveat: regex is the wrong tool for validating emails/URLs/passwords strictly — every real-world regex rejects valid edge cases. Use it for a first pass, then verify with a real parser or a confirmation email.nonsense querybecomesNo built-in pattern matched "nonsense query".
Recognised descriptions: email, url, phone, date, ipv4, uuid, hex color, password, slug, whitespace
General recipe:
1. Anchor it — ^ at the start, $ at the end, so it validates the WHOLE string.
2. Describe each fixed part as a literal or a class: [A-Za-z0-9._%+-]
3. Use non-capturing groups (?:...) unless you need the capture.
4. Prefer a negated class ([^"]*) over .* — it cannot backtrack catastrophically.
5. Test with both matching and NON-matching samples (the second is where bugs live).The query is matched as a lowercase substring against ten fixed key lists, so anything that misses them gets the general recipe and the list of recognised words instead of a pattern.
When to use it
- Getting a starting pattern for a form field instead of writing escape sequences from memory.
- Showing a reviewer what a pattern actually matches before it goes into validation code.
- Learning what each piece of a common regex does, since the breakdown names every group and every literal.
What it does not do
- There is no pattern synthesis. A query is a substring test against ten hard-coded key lists, so 'postal code', 'credit card' or 'semver' return the generic recipe.
- Matching is loose in both directions: one query can print several complete blocks ('email url' returns two), and an unrelated word in your sentence can pull in the wrong pattern.
- The ticks mean the pattern's own four sample strings behaved, nothing more. They are evaluated with re.test() against that same pattern, so a pattern that rejects valid real-world input still shows all green.
- Several built-ins are deliberately loose: the email pattern accepts non-existent domains and rejects quoted local parts, the password pattern only counts character classes, and the URL pattern stops at the query string.
- The Python line prints re.match(r"..."), which anchors at the start of the string. That is equivalent for the anchored patterns, but for the non-anchored whitespace pattern (/\s+/g) Python's re.match only inspects position 0 while JavaScript's test() searches the whole string.