Developer
Regex Tester
Test a regular expression against text, with matches highlighted.
🔒 Runs entirely in your browser — nothing here is ever uploaded
CalcoTools · Regex Tester · generated 9/1/2026, 1:27:31 PM
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
- Enter a Pattern (without the surrounding slashes).
- Toggle the Flags you need — g for all matches, i for case-insensitive, m for multiline anchors, s for dotAll.
- Enter or paste your Test text.
- 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
| Token | Meaning |
|---|---|
| . | 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 |
| \d | Digit (0–9) |
| \w | Word character (letters, digits, underscore) |
| \s | Whitespace character |
| ^ | Start of string (or line, with the m flag) |
| $ | End of string (or line, with the m flag) |
| \b | Word 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.
Sources
- MDN Web Docs — Regular expressions (JavaScript RegExp reference) — accessed 2026-08-25