Regex Tester

Test and debug JavaScript regular expressions in real time. Highlights matches, shows capture groups, supports all flags.

Regex Tester

Test JavaScript regular expressions in real time. Matches are highlighted inline. Supports global, case-insensitive, multiline, and dotAll flags.

Regular Expression

//g
Examples:

Test String

Match Preview

Contact us at support@example.com or sales@company.org.
Visit https://devtoolshub.dev for more tools.
Server IP: 192.168.1.100. Color: #ff6347.

FAQ

Which regex flavor does this use?

This tool uses JavaScript (ECMAScript) regular expressions via the built-in RegExp engine. Most patterns are compatible with JavaScript, Python, and other languages, but some advanced features like lookbehinds may differ.

Why does my match loop infinitely?

Zero-length matches with the global flag can cause infinite loops. This tool automatically advances lastIndex when a zero-length match is found to prevent this.

What does the 's' (dotAll) flag do?

Without the dotAll flag, the . metacharacter does not match newline characters. The s flag makes . match any character including \n.

Frequently Asked Questions

Which regex flavor does this tool use?

JavaScript (ECMAScript) regular expressions — the same engine used in Node.js and all modern browsers. Supports ES2018+ features including named capture groups and the s (dotAll) flag.

What does the g flag do?

The g (global) flag makes the regex find all matches in the string instead of stopping after the first match. Essential for replace-all operations and counting total occurrences.

What are capture groups?

Capture groups, created with parentheses ( ), let you extract specific parts of a match. Named groups (?<name>...) give each group a descriptive label accessible via match.groups.name.