Regex Tester

Write a regular expression and see every match highlighted live, with capture groups, named groups, flags and a replace preview. Uses the JavaScript regex engine.

//

2 matches

Contact agrawatdhruv@gmail.com or hello@dhruvagrawat.com. Invalid: someone@ and @nowhere.
#Matchuserdomain
1agrawatdhruv@gmail.comagrawatdhruvgmail.com
2hello@dhruvagrawat.com.hellodhruvagrawat.com.
Contact <agrawatdhruv at gmail.com> or <hello at dhruvagrawat.com.>
Invalid: someone@ and @nowhere.
Cheat sheet
\ddigit
\wword char
\swhitespace
.any char
^ $start / end
* + ?0+, 1+, 0–1
{2,5}2 to 5 times
[abc]a, b or c
(…)capture group
(?<name>…)named group
a|ba or b
(?=…)lookahead

Frequently asked questions

Which regex flavour is used?

JavaScript (ECMAScript), the same engine your browser and Node.js use. Most syntax also works in Python, Java and PCRE, but lookbehind and named-group syntax can differ.

What do the flags mean?

g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, and u enables full Unicode.

Theme