TOOLTIKI Lovable tool, really free
Developer Patterns

Regex tester

global — find every match, not just the first
Result
Write to [email protected] or [email protected] before Friday.

2 matches

9 [email protected] $1=ada $2=example.com
28 [email protected] $1=grace $2=example.org
What the pattern says
( start of a capturing group
\w a word character — letter, digit or underscore
+ the thing before it, one or more times
) end of the group
@ matched literally
( start of a capturing group
\w a word character — letter, digit or underscore
+ the thing before it, one or more times
\. a literal .
\w a word character — letter, digit or underscore
{2,} the thing before it, 2 or more times
) end of the group
A reading aid, piece by piece — not a full parse.

Runs in your browser · nothing is uploaded

Local · the browser’s own engine
Advertisement
320 × 100

Type a pattern and it runs against your text as you type: matches highlighted in place, capture groups listed with their positions, and a plain-English reading of what each piece of the pattern does. Replace and split are the same pattern applied a different way.

How to use the regex tester

1 Type the pattern between the slashes. Do not include the slashes themselves.
2 Turn flags on and off — g finds every match rather than the first.
3 Paste the text you are testing against. Matches highlight immediately.
4 Switch to Replace to try a substitution, or Split to cut the text on the pattern.

This uses the browser’s own regular-expression engine, which is the same one your JavaScript will run against — so a pattern that works here works in your code, and one that does not will not. That is worth knowing because regex flavours genuinely differ: lookbehind, `\p{…}` properties and named groups all behave differently in PCRE, Python and POSIX, and a pattern copied from a PHP answer may simply not compile here. One pattern shape is refused rather than run. A quantifier nested inside a quantified group — `(a+)+`, `(\d+)*` — can take exponential time on input that nearly matches, and because the engine runs on the same thread as the page there is no way to interrupt it: the tab stops responding and the only fix is closing it. Rather than let that happen, the pattern is rejected with an explanation. The fix is almost always to make the inner quantifier possessive in spirit — match a specific character class instead of nesting repetition. The explanation panel walks the pattern and names each piece. It is a reading aid, not a parser: it does not build a tree or tell you what the pattern means as a whole, and it will not catch a logic error. It is there for the case everyone actually has, which is inheriting a pattern from a colleague and needing to know what `(?<=\s)` was for.

Questions

Yes, it is the browser’s own RegExp. A pattern that works here works in your code.

MDN — Regular expressionsECMA-262 — RegExp objects
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING