About Regex Tester
A regular expression (regex) is a pattern that describes a set of strings, used for searching and validating text. This tool compiles your pattern with the browser's JavaScript RegExp engine (ECMAScript syntax), always adds the g flag, and lists each match with its index and numbered capture groups. It highlights up to 2,000 matches and lists the first 200. Features of other engines, such as PCRE possessive quantifiers or recursion, are not available.
Also known as: JavaScript Regex Tester, Regex Checker.
How to use Regex Tester
- Type or paste into the "Test text" box, or press "Use example" to try it with sample data.
- Set "Pattern" and "Flags" if the defaults do not fit.
- The result appears below and updates as you type.
- Copy the result with the copy button, or download it as a file where that is offered.
Questions about Regex Tester
Will a pattern that works here also work in Python or PHP?
Often, but not always. This tester uses JavaScript syntax. Basic classes, quantifiers, groups, and lookahead are shared, but named group syntax, inline flags, possessive quantifiers, and some escapes differ between engines.
What do the flags g, i, m, and s mean?
The g flag finds all matches instead of the first, i ignores case, m makes the anchors match at each line, and s lets the dot match line breaks. The tool always applies g so every match is listed.
Runs in your browser. Page last updated .