Regex Pattern Builder for Common Formats
Pick a preset to drop in a tested regular expression for everyday formats like email, URL, IPv4, UUID, dates and hex colors, or check boxes to compose a password rule with the right lookaheads. Every pattern is copy-ready and built right in your browser.
How to build a regular expression
- Choose a preset such as email or UUID, or open the password builder.
- For passwords, set the minimum length and tick the character rules you need.
- Try a value in the live test box, then copy the finished pattern.
Examples
Email preset
Click the Email preset
^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$ which matches a@b.comPassword rule
Minimum length 8, require uppercase and a digit
^(?=.*[A-Z])(?=.*\d).{8,}$ which matches Abcdef12 but not abcdefFrequently asked questions
Which presets are included?
Email, URL, IPv4, IPv6, US phone, ISO date, 24-hour time, hex color, slug, username, UUID, credit card and US ZIP. Each one is a well-known pattern that matches valid examples.
How does the password builder work?
Each rule you tick adds a lookahead, so requiring an uppercase letter adds (?=.*[A-Z]) and a digit adds (?=.*\d). The minimum length becomes .{min,} and the whole thing is anchored with ^ and $.
Are these patterns perfect for validation?
They cover the common, well-formed cases and reject obvious junk. Formats like email and credit card have edge cases no single regex captures, so treat the result as a strong first check rather than a full specification.
Do I include the slashes when I use the pattern?
No. Copy the source as shown and add it to your code with whatever delimiters your language uses, plus any flags you want such as i for case-insensitive matching.
Which regex dialect is this?
The patterns use JavaScript RegExp syntax, which shares most features with other languages. A few escapes and group types follow the ECMAScript rules, so adjust if your engine differs.
Is anything I type sent to a server?
No. The presets, the password builder and the live test box all run entirely in your browser, so nothing you enter is uploaded.
Related tools
Regex Tester
Test a regular expression against text with live match highlighting, capture groups and flags. See every match and replace text. Runs in your browser.
Regex Explainer
Paste a regular expression to get a plain-English, token-by-token breakdown of what every part does, plus a summary and flag guide. Runs in your browser.
Glob Tester
Test glob patterns against file paths with live results. Supports *, **, ?, character classes and brace alternation. Runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.