Explain each token, group, quantifier, and assertion in a JavaScript regular expression.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
The expression is tokenized into literals, character classes, groups, quantifiers, assertions, and alternations; each token is described with its matching scope. The explanation follows JavaScript syntax and does not execute replacement code.
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
This regex matches: at the start of the string, then any character in [a-zA-Z0-9._%+-], then repeated one or more times, then the character '@', then any character in [a-zA-Z0-9.-], then repeated one or more times, then the literal character '.', then any character in [a-zA-Z], then repeated 2 or more times, then at the end of the string
Validation docs, code reviews, and support debugging explain regex tokens.