All tools
Developer

Regex Tester

Test a regular expression against text, with matches highlighted.

🔒 Runs entirely in your browser — nothing here is ever uploaded

About the Regex Tester

Tests a regular expression against sample text, highlighting every match directly in the text, using your browser's native, standards-compliant regex engine.

100% Free Runs in Your Browser No Sign-Up Required
How to use it
  1. Enter a Pattern (without the surrounding slashes).
  2. Toggle the Flags you need — g for all matches, i for case-insensitive, m for multiline anchors, s for dotAll.
  3. Enter or paste your Test text.
  4. Read the match count and see every match highlighted in the text below.
Formula
Uses JavaScript's built-in RegExp engine (ECMA-262) directly — the same regex dialect and matching behavior your pattern would have in actual browser or Node.js code, not a separate simplified implementation.
Worked example

The pattern \b[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}\b with the g and i flags finds every email-like substring in a block of text, highlighting each one in place.

JavaScript regex metacharacter cheat sheet
JavaScript regex metacharacter cheat sheet
TokenMeaning
.Any character except a line terminator
*0 or more of the preceding token
+1 or more of the preceding token
?0 or 1 of the preceding token (or makes the preceding quantifier lazy)
{n,m}Between n and m repetitions
\dDigit (0–9)
\wWord character (letters, digits, underscore)
\sWhitespace character
^Start of string (or line, with the m flag)
$End of string (or line, with the m flag)
\bWord boundary
[...]Character class — any one of the listed characters
(...)Capture group
|Alternation (OR)
Recommendations
  • Without the g (global) flag, only the first match is found — turn it on whenever you expect (or want to check for) more than one match.
  • The m (multiline) flag changes what ^ and $ mean — they match the start/end of each line instead of the start/end of the whole string, which matters for multi-line test text.
  • An invalid pattern (unbalanced parentheses, a bad escape sequence) shows a real JavaScript regex error message — the exact error your own code would throw if you used that pattern directly.
Frequently asked questions
Yes — it runs JavaScript's native RegExp directly in your browser, so a pattern that works here will behave identically in actual JavaScript or Node.js code. Other languages (Python, PCRE, etc.) have their own regex dialects with some differences.