Regex Tester
A regex tester lets you try a regular expression against sample text and see exactly what it matches. This free tool uses your browser's JavaScript regex engine, highlights every match as you type, lists capture and named groups with their positions, supports the g, i, m, s, u and y flags, previews replacements and explains why a pattern is invalid.
Free, no signup. Runs entirely in your browser; files and text are not uploaded.
How to use the Regex Tester
- Type your pattern into the Regular expression box, or paste a literal such as /ab+c/gi.
- Tick the flags you need, such as g for all matches or i to ignore case.
- Paste the text to search into the Test string box.
- Review the highlighted matches and the match details with capture groups.
- Tick Replace matches and enter a replacement such as $1 to preview a find-and-replace.
Features
- Live matching with highlighted results
- Match list with index positions, capture groups and named groups
- All JavaScript flags: g, i, m, s, u and y
- Replace preview with $1, lt;name> and amp; references
- Clear error message for invalid patterns
- Pauses live matching for patterns prone to catastrophic backtracking
- Preset patterns for emails, URLs, IPv4 addresses, dates and hex colours
Frequently asked questions
Which regex flavour does this tester use?
It uses the JavaScript (ECMAScript) engine built into your browser, so results match RegExp in Node.js and front-end code. PCRE-only syntax such as possessive quantifiers is not supported.
Why does my pattern only find one match?
Without the g (global) flag a JavaScript regex stops after the first match. Tick g to find every match.
What does the u flag change?
The u flag enables full Unicode matching, so emoji and other astral characters count as one character, and it makes the syntax stricter: for example, unnecessary escapes become errors.
Why did live matching pause?
Patterns with nested quantifiers such as (a+)+ can take exponential time on some inputs and freeze the page. The tester detects these and waits for you to click Run once.
Related tools
- URL Encoder – Percent-encode or decode URLs and query strings, with form (+) and component modes
- JSON Formatter – Beautify, minify and validate JSON with error line numbers, key sorting and auto-fix
- Text Case Converter – Convert text to sentence, upper, lower, title, camelCase, snake_case, kebab-case and more
- Word Counter – Count words, characters, sentences and paragraphs with reading time, readability and keyword density
Built and reviewed by Naqash Thaheem, Technical Project Manager. Last reviewed 2026-09-24.