Loading tool…
Setting up your workspace on this device.
Test regular expressions.
Loading tool…
Setting up your workspace on this device.
Advertisement
Regex Tester lets you write a regular expression and see what it matches as you type. Matches are highlighted in your test string and listed with their start and end positions, numbered capture groups and named groups. Toggle the g, i, m, s, u and y flags with buttons instead of typing them, and fill in a replacement template such as $3/$2/$1 to preview a search-and-replace before you put it in code. Sample patterns for email addresses, hex colours, dates and HTML tags help you get started. Patterns run on your browser’s own JavaScript regex engine.
Enter a pattern
Type your regular expression without the surrounding slashes, or click one of the sample patterns.
Set flags and test text
Toggle flags such as g (Global) and i (Ignore case), then paste the text you want to search.
Inspect and replace
Review the highlighted matches and groups, add a replacement template and press Copy replacement result.
It uses the JavaScript (ECMAScript) engine built into your browser, the same one behind RegExp in JavaScript and TypeScript. Most syntax carries over to other languages, but check details such as lookbehind and named-group syntax if you are targeting Python, PHP or Java.
Without the g (Global) flag, a JavaScript regex stops after the first match. Turn on g to list every match in the test string.
Wrap part of the pattern in parentheses and refer to it as $1, $2 and so on in the replacement template. With the Dates sample, the template $3/$2/$1 turns 2026-03-30 into 30/03/2026.
m (Multiline) makes ^ and $ match at the start and end of each line rather than the whole text. s (Dotall) lets the dot match newline characters too.
Yes. Regex Tester is completely free, with no account, no paywall, and no usage limits.
No. Regex Tester works instantly in any modern web browser — there is no software to install, no extension, and no sign-up.