Regex Tester
Test a regular expression against sample text with live highlighting and capture groups.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the regex tester
- Type your pattern, without the surrounding slashes.
- Set flags such as g (global), i (ignore case) and m (multiline).
- Paste test text below and read the highlighted matches.
About this tool
Regular expressions are best written incrementally, checking each addition against real text. This tester runs your pattern on every keystroke and lists each match with its index and capture groups, so you can see immediately when a change starts over-matching.
The flavour is JavaScript's, which is what runs in browsers and Node. Patterns written for PCRE, Python or Go mostly transfer, but lookbehind support, named group syntax and some escapes differ — test before you rely on a pattern in another language.
Common uses
- Building a validation pattern for a form field.
- Extracting fields from log lines.
- Checking that a pattern does not match something it should ignore.
Frequently asked questions
- Which regex flavour is used?
- JavaScript (ECMAScript). Patterns run through the browser's own regex engine, so results match what your front-end or Node code will do.
- Why does my pattern hang or feel slow?
- Nested quantifiers such as (a+)+ can cause catastrophic backtracking on certain inputs. Simplify the pattern or anchor it so the engine fails faster.
Related tools
JSON Formatter
Format, validate and minify JSON with clear error messages that point at the exact position.
Text Diff Checker
Compare two blocks of text line by line and highlight what was added, removed and unchanged.
HTML Entity Encoder & Decoder
Escape text for safe use in HTML, or decode entities back into readable characters.
URL Encoder & Decoder
Percent-encode text for safe use in URLs, or decode an encoded URL back to readable text.