Regex Tester
Write the pattern, watch it match, see the capture groups.
Just the expression — no surrounding slashes.
Everything is processed on your device. Nothing you upload or type is sent to a server, and nothing is stored.
Regex Tester online
A regular expression is quick to write and very hard to read back, so the only reliable way to know what one does is to run it against real text and look. Type a pattern and it is applied as you type — matches highlighted in place, capture groups listed underneath, and a plain-English error the moment the pattern stops being valid. It uses your browser's own engine, so what you see here is exactly what JavaScript will do.
How to use regex tester
Enter your pattern
Just the expression — no surrounding slashes needed.
Set the flags
g for every match rather than the first, i to ignore case, m to make ^ and $ match each line, s to let . cross newlines.
Paste your test text
Whatever you are trying to match against.
Read the matches
Highlights appear in the text, and each match is listed below with its position and any capture groups.
Frequently asked questions
Which flavour of regex is this?
JavaScript's, because it runs on your browser's own engine. It is close to PCRE for everyday patterns, but not identical — lookbehind support varies by browser, and there is no /x verbose mode. A pattern from Python or PHP usually works, but test it rather than assuming.
What do the flags actually do?
g finds every match instead of stopping at the first. i ignores case. m makes ^ and $ match at every line break rather than only at the ends of the text. s lets . match a newline, which it otherwise never does — that one catches people out constantly.
What is a capture group?
Anything in round brackets is captured, so you can pull a piece out of the match rather than just finding it. Name them with (?<year>\d{4}) and they are listed by name. Use (?:…) when you want to group something without capturing it.
Why did my pattern make the page hang?
Almost certainly catastrophic backtracking — nested quantifiers like (a+)+ against a long non-matching string make the engine try an exponential number of paths. This tool caps the size of the test text to keep that survivable, but the real fix is to rewrite the pattern so the alternatives cannot overlap.
Is my pattern or my text sent anywhere?
No. Both stay in the page. That matters more than it sounds — the text people test against is usually a sample of real production data.
You might also like
Developer ToolsJSON FormatterFormat, validate and minify JSON with clear error messages.
Text ToolsText DiffCompare two blocks of text and see exactly which lines were added or removed.
Developer ToolsBase64 Encoder / DecoderEncode text to Base64 and decode it back, with full Unicode support.
Developer ToolsURL Encoder / DecoderPercent-encode and decode URLs, query strings and parameters.
