Tools/Developer Tools/Regex Tester

JavaScript Regex Tester – Test Patterns with Capture Groups

Free online regex tester to test regular expressions against any text. Highlights all matches, shows match count, groups, and index positions instantly.

About this tool

JavaScript regex has quirks that PCRE testers won't surface - stricter lookbehind rules in older runtimes, no atomic groups, different flag behavior. Testing in the actual JS engine before shipping means fewer production surprises.

This runs the JavaScript RegExp engine - the same one your browser uses. If your regex passes here, it passes in production JS code. Useful for testing patterns before embedding them in validators or parsers, and for debugging when a pattern works in a PCRE tester but not in your JavaScript.

How to use Regex Tester

  1. Step 1: Enter Pattern. Type your regex pattern and select the flags you need.
  2. Step 2: Paste Test Text. Add the string you want to test the pattern against.
  3. Step 3: See Matches. Matching text is highlighted and match details appear below.
  4. Step 4: Review Groups. Check match count, index positions, and capture groups.

Where this tool helps

Test an email or phone validation regex before adding it to a form. Debug a pattern that matches too much or too little. Inspect capture group values from a string parser. Verify flag behavior across global, multiline, and sticky modes.

  • Capture groups, named groups, and match indexes all display on every test.
  • Supports all JavaScript regex flags: g, i, m, s, u, y.
  • PCRE testers like regex101 use a different engine - results there may differ from JS. This one won't.

The most common debugging question is why a regex that worked elsewhere fails in JavaScript. The FAQ covers engine differences, greedy vs lazy, and capture group indexing.

How to Use Regex Tester Converter

Enter Pattern

Type your regex pattern and select the flags you need.

Paste Test Text

Add the string you want to test the pattern against.

See Matches

Matching text is highlighted and match details appear below.

Review Groups

Check match count, index positions, and capture groups.

FAQs

Common questions about this tool and how to use it.

Which regex flags does this tester support?

This tester supports global (g), case-insensitive (i), multiline (m), and dotAll (s) flags.

Does it show capture groups?

Yes. Each match card shows the full match, its start index, and any named or indexed capture groups.

What regex engine does it use?

It uses the JavaScript built-in RegExp engine - perfect for testing patterns used in Node.js, browsers, and TypeScript.

Get more tools like this

Leave your email so we can prioritize similar tools and updates.

Trending Tools

Trending tools will appear as visitors explore the catalog.

Recently Used

Your recently visited tools will show up here.