Enter a pattern and some text to see every match, live.
Regular expressions (regex) are compact patterns for finding, validating and extracting text, such as email addresses in a document, dates in a log file, or a valid postcode in a form field. They are powerful but easy to get subtly wrong, so it's worth testing a pattern against real sample text before putting it in code.
This tester runs your pattern live in your browser's JavaScript engine and lists every match. Nothing you paste is sent to a server.
. any character except a newline · \d digit · \w letter, digit or underscore · \s whitespace* zero or more · + one or more · ? optional · {2,4} between 2 and 4 times[abc] any one of a, b, c · [^abc] anything except those · ^ / $ start / end of a line or string( ) capture group · (?: ) non-capturing group · a|b either a or bFlags change how the whole pattern behaves: g finds every match, i ignores case, m makes ^ and $ match at each line, and s lets . match newlines.
With the pattern [\w.+-]+@[\w-]+\.[\w.]+ and the g flag, the sample text returns two matches: hello@multiswitch.app and support@example.org. Remove the g flag and only the first is returned. That is the most common reason a pattern seems to “only find one”.
This tester uses JavaScript's regex engine. Most syntax is shared, but there are differences: named groups are written differently in some languages, and certain features such as possessive quantifiers or inline modifiers aren't supported in JavaScript. Test in the target language before shipping.
Escape it with a backslash: \., \[, \?. Without the backslash these characters have special meanings. A bare . matches any character.
* and + are greedy: they grab as much text as they can. Add ? to make them lazy. For example, <.+?> matches one HTML tag at a time, where <.+> runs to the last > on the line.
For a quick sanity check, yes. A simple pattern catches obvious typos. A fully standards-compliant email regex is huge and still can't prove the address exists, so the only real test is sending a confirmation email.