Why developers test email regex by hand
Almost every website checks that an email address looks right before it accepts it, and the check is usually a regular expression, a small pattern that describes what an email looks like. Writing that pattern is easy to get wrong: a pattern that is too strict rejects real emails, and a pattern that is too loose accepts nonsense like plain text with no @ sign. The only way to know is to test the pattern against real examples.
That is what this tool does. You type the pattern and a list of sample emails, and it tells you which ones match. A good test set has valid emails, clearly invalid ones, and edge cases like a plus sign in the name or a long domain, because those are the cases where patterns usually break.
How to use the tester
Press Load email preset to fill in a simple email pattern and three samples, or type your own pattern in the first box. Type your sample emails in the second box, one per line. Press Test the pattern, and the tool shows how many samples match and which ones they are.
The preset pattern is a simple one: some text, an @ sign, some text, a dot, and some text. It accepts most real emails and rejects plain text and addresses with no dot in the domain. Edit the pattern to try your own version, and watch which samples change from match to no match.
Worked example
Take the preset pattern and four samples: test@example.com, plainaddress, name@domain.co.uk, and user+tag@mail.example.org. The tool says 3 of 4 samples match. test@example.com matches, because it has text, an @ sign, a domain, a dot, and an ending. plainaddress does not match, because it has no @ sign. name@domain.co.uk matches, because the pattern allows dots in the domain. user+tag@mail.example.org matches too, because the plus sign is allowed in the text before the @ sign.
Take a bad pattern, like an opening bracket with no close, and the tool tells you the pattern is not valid regex. Take a sample like a@b, which has no dot, and the tool says no match, because the pattern needs a dot and an ending after the domain.
Who uses this tester
Web developers use it most, because they write email checks for sign-up forms and need to test the pattern before they ship it. A pattern that rejects real users costs sign-ups, so they test it against a list of real and fake addresses first.
Students learning regex use it too, because email is the classic first pattern to learn, and seeing matches live makes the symbols make sense. QA testers use it to check a form’s validation without writing code, by copying the pattern from the form into the tool.
Honest limitations
This tool checks whether a whole line fits the pattern, not whether the email address really exists. An address can match the pattern and still bounce, because the mailbox does not exist. The tool cannot check that, and no regex can.
The preset pattern is simple on purpose. It accepts some addresses that a strict check would reject, and it rejects some rare but valid addresses, like one with a quoted name. For a real form, use a well-tested email library instead of a hand-written pattern, and use this tool to learn and to test, not to validate real users.
Frequently asked questions
What does the preset pattern mean? It means: one or more characters that are not a space or an @ sign, then an @ sign, then one or more characters that are not a space or an @ sign, then a dot, then one or more characters that are not a space or an @ sign.
Why does a@b not match? Because the pattern needs a dot and a domain ending after the @ sign, and a@b has no dot. Most real domains have a dot, so the pattern is right to reject it.
Can I test a pattern for phone numbers? Yes, type any pattern you like and any samples. The tool tests the pattern you give it, not only email patterns.
Does the tool send my samples anywhere? No. The testing runs in your browser, and nothing is sent to a server or stored.
También disponible en español: Probador De Regex Para Correos Electrónicos – Prueba Tu Patrón En Vivo
