Regular expressions (regex) are powerful but notoriously difficult to write and debug without immediate visual feedback. Our free online regex tester shows you exactly which parts of your test string match your pattern, highlighted in real time as you type. The match counter tells you how many matches were found, and the match list below details each match with its position index — making it easy to understand and debug complex patterns. Supports standard JavaScript regex syntax including flags: g (global), i (case-insensitive), m (multiline), s (dot-all), and u (unicode). No server requests — all matching runs locally in your browser.
How to Use the Regex Tester
- Type your regular expression pattern in the pattern field (between the / delimiters).
- Type or adjust the flags in the small field after the closing / (default:
gfor global matching). - Paste your test string in the text area below.
- Matches are highlighted in yellow in real time.
- The status badge shows the match count. The match list below shows each match and its character index.
Regex Flags Reference
g— global: find all matches, not just the first.i— case-insensitive: match uppercase and lowercase letters equally.m— multiline:^and$match the start/end of each line, not just the whole string.s— dot-all:.matches newline characters too.u— unicode: enables full Unicode matching, needed for emoji and non-BMP characters.
Frequently Asked Questions
What regex flavour does this tester use?
JavaScript (ECMAScript). This is identical to the regex engine in Node.js, Chrome, Firefox, Safari, and Edge. If you're writing regex for Python, PHP, or .NET, there are minor syntax differences (e.g., named groups, lookbehind support).
Why is my regex matching too much?
Check that you're using quantifiers correctly. .* is greedy and matches as much as possible. Use .*? (lazy) to match as little as possible. Also check if the s flag is accidentally enabled, making . match newlines.
Can I use lookaheads and lookbehinds?
Yes. Modern browsers (Chrome 62+, Firefox 78+) support both positive/negative lookaheads ((?=...), (?!...)) and lookbehinds ((?<=...), (?<!...)).
