Free Regex Tester Online
Test JavaScript regular expressions with live match highlighting. Supports all JS regex flags (g, i, m, s, u). Capture groups are listed individually. Auto-saves your last pattern.
About the Regex Tester
This free regex tester uses the browser's built-in JavaScript RegExp engine. As you type your pattern or test string, matches are highlighted in real time with yellow background. Each match and its capture groups are listed below for easy inspection.
The tool auto-saves your last used pattern and test string to localStorage so they are preserved between sessions.
JavaScript Regex Flags Reference
| Flag | Meaning |
|---|---|
| g | Global — find all matches, not just the first |
| i | Case-insensitive matching |
| m | Multiline — ^ and $ match start/end of each line |
| s | Dotall — . matches newline characters |
| u | Unicode — enable Unicode code point escapes |
Frequently Asked Questions
JavaScript ECMAScript RegExp. Patterns are compatible with any JavaScript runtime (Node.js, browsers). They are broadly similar to Perl-compatible regular expressions (PCRE) but differ in features like look-behind and named groups.
Capture groups are portions of the pattern enclosed in parentheses. When a match is found, the text matched by each group is available individually. They are shown in the match details below the highlight area.
Catastrophic backtracking can occur with poorly constructed patterns on large strings. Patterns like (a+)+ against a long string cause exponential time complexity. Simplify nested quantifiers to avoid this.