DevFmt/

Regex Tester

//g
Test String
Matches

How to use Regex Tester

Regex Tester lets you build and test JavaScript regular expressions against your own sample text with live, highlighted matching. As you type a pattern, every match is highlighted in the test string and the captured groups are listed — so you can see exactly what your expression matches and why.

Enter your pattern, choose your flags, and paste the text you want to test against. Matches update instantly as you edit either the pattern or the text, making it fast to iterate toward the regex you need.

Key features: real-time match highlighting, capture-group display, support for the global (g), case-insensitive (i), multiline (m), and dotAll (s) flags, and match count in the status bar.

A regex tester is essential for writing validation rules, search-and-replace patterns, log parsing, and data extraction without trial-and-error in your code editor. Because the tester uses your browser's own JavaScript regex engine, the behavior matches exactly what you'll get in Node.js and browser code — and your patterns and test data never leave your machine.

FAQ

How do I test a regular expression?
Type your regex pattern into the pattern field and paste sample text into the test area. Every match is highlighted instantly, and captured groups are listed so you can verify your pattern works as intended.
Which regex flavor does this use?
It uses the JavaScript (ECMAScript) regex engine built into your browser, so results match exactly what you'll get in Node.js and front-end JavaScript code.
What do the g, i, m, and s flags do?
g finds all matches instead of just the first, i makes matching case-insensitive, m makes ^ and $ match line boundaries, and s (dotAll) lets the dot match newline characters.
Are my pattern and text kept private?
Yes. All matching runs locally in your browser. Your regex and test data are never sent to a server.

We use cookies for anonymous analytics and ads. Your tool data never leaves your browser.