Regex Tester
Test a regular expression against text and see every match highlighted.
Runs in your browser. Nothing you open or type here is uploaded.
How to use
- Type the regular expression into the Pattern field.
- Add flags if you need them, such as g, i or m.
- Paste the text to test against.
- Read the highlighted matches and the match count.
Details
The tester runs a JavaScript (ECMAScript) regular expression against your text and highlights every match in place, with a count. Flags change the search: g finds all matches instead of stopping at the first, i ignores case, and m makes ^ and $ match the start and end of each line rather than of the whole text. Because the engine is the browser's own, the behavior you see is the behavior your JavaScript will get.
- Without the g flag the tester reports only the first match, which can hide how a pattern behaves on the rest of the text.
- A pattern that matches empty strings (such as \d*) will match at every position; make the core of the pattern required, e.g. \d+, when you expect at least one character.
Common questions
Is my text uploaded?
No. Everything runs in your browser — safe for sensitive test data.
Which regex flavor?
JavaScript (ECMAScript) regular expressions, the same your browser uses.
What do the flags do?
g finds all matches, i ignores case, m makes ^ and $ match line boundaries.