New to regex? Click "Load example" below to see a working pattern, then change it and watch the results update.
This is the shape of text you're looking for.
We'll search this text for anything matching your pattern above.
Every match will be highlighted here, with any capture groups broken out underneath.
Type what should replace each match. Use $1, $2 to reuse a capture group's text.
Complete steps 1–3 first.
A regular expression (regex) is a small pattern language for matching text. Instead of searching for one exact word, you describe a shape — "a digit followed by three letters", "anything inside quotes", "an email address" — and the regex engine finds every part of your text that fits. That's the same tool behind search-and-replace, form validation, and log parsing in almost every programming language.
.Any character except a newline\dAny digit (0–9)\wAny letter, digit, or underscore\sAny whitespace (space, tab, newline)^Start of the string (or line, with m)$End of the string (or line, with m)*Zero or more of the previous token+One or more of the previous token?Zero or one of the previous token{2,4}Between 2 and 4 repetitions[abc]Any one of the characters a, b, or c(...)A capture group you can reuse or extracta|bEither a or b\.A literal character (escape special symbols)A regular expression (regex) is a compact pattern language for matching text — finding every email address in a document, validating a phone number format, or pulling a specific piece out of a log line. A regex tester lets you write a pattern and immediately see which parts of your sample text it matches, instead of guessing and re-running code.
This tool highlights every match live as you type, breaks out any capture groups separately, and lets you preview a find-and-replace before using it in real code.
The pattern and flags you enter are compiled into a native JavaScript RegExp and run directly against your sample text using the browser's own regex engine — the same engine that runs .match(), .test(), and .replace() in any JavaScript code.
Because it's the real engine, anything that matches here will match identically in JavaScript code using the same pattern.
Pattern: (\w+)@(\w+\.\w+), Flag: g
Without it, a regex only finds the first match in the text. With "g" (global), it finds every match.
Check that special characters that should be literal (like a period in an email, or a dollar sign in a price) are escaped with a backslash — \. and \$ — since unescaped they mean "any character" and "end of string."
Parentheses (...) around part of a pattern "capture" that matched text separately, so you can extract or reuse it — for example (\w+)@(\w+) captures the username and domain of an email as two separate groups.
Yes — it runs on the browser's native RegExp engine, so the syntax and behavior match JavaScript exactly, which may differ slightly from Python, PCRE, or other regex flavors in edge cases.
No — matching happens entirely in your browser; nothing you type is uploaded.