Example strings
Each line becomes a sample input for pattern generation.
Email pattern
High confidence/^[^\s@]+@[^\s@]+\.[^\s@]+$/iMatch standard email-style addresses.
Smart Regex Builder
Generate and test regex for password rules — length, uppercase, digits, and special characters — in a browser-based regex builder that explains the pattern.
Quick modeAutosaves in this browser
Quick templates
Example strings
Each line becomes a sample input for pattern generation.
Email pattern
High confidence/^[^\s@]+@[^\s@]+\.[^\s@]+$/iMatch standard email-style addresses.
Generated pattern
Use the generated regex as-is, or move it into test mode to tweak flags and cases.
/^[^\s@]+@[^\s@]+\.[^\s@]+$/iLive results
See the regex, what it means, and which test lines pass without digging through token noise.
Active regex
/^[^\s@]+@[^\s@]+\.[^\s@]+$/i3 lines • 3 matched • 0 unmatched
Pattern summary
Email pattern • High confidence
Match standard email-style addresses.
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/i;
One row per test string
Case 1
Matchedalex@example.com✔ Full line matched.
Case 2
Matchedmaya@company.io✔ Full line matched.
Case 3
Matchedtest.user@site.dev✔ Full line matched.
^Start of string
Match from the start of the string.
[^\s@]+One or more character outside sets
Match one or more character outside sets.
@@ symbol
Match the @ character.
[^\s@]+One or more character outside sets
Match one or more character outside sets.
\.Literal .
Match the literal character ..
[^\s@]+One or more character outside sets
Match one or more character outside sets.
$End of string
Match up to the end of the string.
Why it helps
Compose length, uppercase, lowercase, digit, and symbol requirements without hand-writing lookaheads.
Test example passwords that should pass and fail so the rule matches your policy exactly.
Read a plain-English explanation of each lookahead so the policy stays reviewable.
How to use it
List the rules your policy needs, like minimum length and required character classes.
Test passwords that should pass and near-misses that should fail.
Copy the pattern into signup, reset, and change-password validation.
Quick tips
A common baseline is ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$ — each lookahead adds one requirement without fixing character order.
Length is the strongest single rule; prefer a higher minimum over exotic symbol requirements.
Keep the same regex on client and server so users never see two different verdicts for one password.
FAQ
Yes. The builder composes lookahead-based patterns for character-class requirements and lets you test them against sample passwords.
Each (?=.*X) lookahead asserts that X appears somewhere in the password without consuming characters, so rules combine independently of order.
Regex handles composition rules well, but also check length generously and consider a breached-password list — length beats symbol complexity for real strength.
Yes. Test passing and failing examples side by side so the policy behaves exactly as written before it reaches a form.
This page focuses on one search intent. The main tool page includes the broader product overview, related workflows, and full use cases.