Task Flow Hub
Home / Free tools / Regex Tester with Match Highlighting

Regular expression tester (JavaScript)

Enter a pattern and flags, paste some text, and see every match and group as you type.

About this tool

JavaScript flavour. It uses your browser's own regular expression engine. Other languages such as PCRE, Python or .NET differ in some features, so confirm in your target language.

Groups. Numbered and named capture groups are listed for each match, and unmatched optional groups are shown as such.

Safety limits. Text is limited to 20,000 characters and 500 matches. The test runs in a background worker and is stopped after 2 seconds, which protects the page from patterns that backtrack badly. A stopped test means the pattern is risky on that text.

Invalid patterns. A broken pattern shows the browser's error message instead of failing silently.

Frequently asked questions

What do the flags mean?

g finds all matches, i ignores case, m makes ^ and $ match at each line, s lets the dot match line breaks, and u turns on Unicode mode.

Why was my test stopped?

The pattern took more than 2 seconds. This often happens with a repeated group that contains its own repeat, such as (a+)+. Simplify it or test a shorter sample.

Is my text sent anywhere?

No. The matching runs in your browser.

More free tools

Explore more free tools or see our services.