Type your expression
Or start from one of the examples, such as email, URL or date.
Type a JavaScript regular expression and some text and see every match highlighted, with the position and each capture group. Try a replacement, and start from a ready-made example.
100% private — the expression runs in your browser, in a separate worker, and nothing is sent anywhere.
Keep going with your result in another tool. Nothing is uploaded.
Or start from one of the examples, such as email, URL or date.
Matches are highlighted as you type, with their position and groups.
Use $1 or $
Regular expressions are compact, powerful and easy to get subtly wrong: a dot that matches too much, a greedy quantifier that swallows half the line, a missing escape. The fastest way to get one right is to try it on real text and see what it catches. This tester highlights every match live, lists the position and the capture groups of each and can also try a replacement, so you can build an expression step by step and see the effect of every change.
The five checkboxes are the JavaScript flags. g finds all the matches instead of only the first. i ignores upper and lower case. m makes ^ and $ match at the start and end of each line. s lets the dot match line breaks. u turns on full Unicode support, so patterns such as \p{L} for any letter work. Hover over a flag for its meaning.
The tester uses your browser's own regular expression engine, so it follows JavaScript rules: character classes such as \d, \w and \s, anchors, groups, non-capturing groups, lookahead and lookbehind, and named groups. Other languages, such as PCRE in PHP and Perl, Python and Java, are similar but differ in details such as lookbehind rules, flags and some escapes, so test in the target environment before relying on a pattern.
Some expressions can take exponentially long on certain text, a problem known as catastrophic backtracking, and could freeze a page. Here the expression runs in a separate worker that is stopped after two seconds, and you are told when that happens, so a bad pattern cannot lock up your browser.
It does not explain the expression in words or generate patterns from examples, and it shows at most the first 2,000 matches. The special characters of the pattern are interpreted as in a JavaScript regex literal, without the slashes. To clean text before matching, use the text cleaner.
More utilities that also run without leaving your browser.