Testing a regular expression means running it against sample text to see what it matches before you put it in code. To test a regex, type your pattern and flags into a regex tester, paste some text, and watch the matches highlight live. This guide covers the flags, capture groups, and how to debug a pattern that is not matching.
Type the regular expression (no surrounding slashes needed).
Toggle global, ignore-case, multiline and dotall depending on what you need.
Add realistic sample text and watch every match highlight instantly.
Inspect the capture groups for each match to confirm you are extracting the right parts.
What do the regex flags mean?
g (global) finds all matches, not just the first. i makes it case-insensitive. m (multiline) makes ^ and $ match the start and end of each line. s (dotall) lets . match newlines. The regex tester lets you toggle each and see the effect immediately.
How do capture groups work?
Parentheses ( ) create a capture group, and the text each group matched is shown per match — useful for pulling out parts like the area code from a phone number. Named groups (?<name>…) are labelled by name. This is the JavaScript (ECMAScript) regex engine, the same one in your browser and Node.
Why isn’t my regex matching?
Common causes: a special character like ., *, +, ? or ( not escaped with a backslash; needing the m flag for line anchors; or a greedy quantifier matching too much (try a lazy *?). Test small pieces and build up.
Tip: Escape literal dots and slashes (\. and \/) — an unescaped dot matches any character, which is the most common reason a pattern “matches too much”.
Test your regex now
Build and debug a regular expression with live highlighting and groups — free, in your browser.
Open the Regex Tester →Frequently Asked Questions
How do I test a regex?
Enter the pattern and flags in a regex tester and paste sample text. Matches highlight live and capture groups are listed.
Which regex syntax is supported?
JavaScript (ECMAScript) regular expressions, the same engine used by browsers and Node.js.
Is my pattern or text uploaded?
No — matching runs entirely in your browser, so nothing leaves your device.