$ loading▍
$ loading▍
Test JavaScript regular expressions against your own text. Matches light up as you type, groups are listed, and every piece of the pattern is explained in plain English.
Regular expression
Test text
Replace
Turn on to preview a search-and-replace with capture groups.
Explanation
[\w.+-]+one of: word characters, ., +, -, one or more times@the character “@”[\w-]+one of: word characters, -, one or more times(?:start of a group that isn't captured\.a literal “.”[\w-]+one of: word characters, -, one or more times)+end of the group, one or more timesMatches
Matches will be listed here.
Matches light up in your text as you type, with each match's position and capture groups listed underneath.
Each piece of the pattern is spelled out: “\d{3}” becomes “a digit, exactly 3 times”. Handy for reading someone else's regex.
Matching runs in a background worker with a time limit, so a catastrophic pattern stops after a second instead of hanging your tab.
// faq
JavaScript's (ECMAScript), as built into your browser, so results match what RegExp and String.match do in Node.js and the browser. Most syntax is shared with PCRE, Python and Java, but lookbehind support, named-group syntax and some escapes differ between languages.
g finds every match instead of the first; i ignores case; m makes ^ and $ match at line breaks; s lets . match line breaks; u enables full Unicode (and \p{…} classes); y (sticky) only matches at the current position.
Turn on Replace and use $1, $2… for numbered groups, $<name> for named groups, $& for the whole match, and $$ for a literal dollar sign. The preview shows the result of String.prototype.replace.
Some patterns, like (a+)+$, take exponential time on certain inputs; this is called catastrophic backtracking. The tester stops after about a second. Make nested quantifiers more specific or use atomic alternatives to fix it.
No. Matching happens in your browser. A share link contains the pattern and text, so only share it when you mean to.
Looking for something bigger? The products are full apps: an encrypted password vault, self-hosted CI/CD, and more.