Regex Tester Online — Test JavaScript Regular Expressions

Use this regex tester online to run JavaScript regular expressions against sample text and inspect matches, indexes and capture groups locally.

About this tool

This online regular expression tester creates a native JavaScript RegExp from your pattern and flags, then lists every match with its character index and capture groups. It follows JavaScript regex syntax rather than PCRE, Python or .NET behavior.

How to use

  1. Enter a JavaScript regular expression pattern without surrounding slash delimiters.
  2. Add flags such as g, i, m, s or u and paste the sample text.
  3. Run the test and inspect each match, index and captured group.

Features

  • Uses the browser native JavaScript RegExp engine.
  • Shows match text, character index and capture groups.
  • Runs patterns and sample text locally.

Common use cases

  • Debug a validation or extraction pattern.
  • Test capture groups before adding a regex to code.
  • Compare case-sensitive, multiline and Unicode matching behavior.

Common issues and tips

  • Do not include /pattern/ slash delimiters in the pattern field.
  • The tester uses matchAll, so include the global g flag to enumerate matches.

Privacy

Regex testing runs locally in your browser. Patterns and sample text are not uploaded to Tools12345.

Frequently asked questions

Which regex flavor does this tester use?

It uses the native JavaScript RegExp implementation in your current browser.

Why is a PCRE pattern invalid here?

PCRE, Python, Java, .NET and JavaScript support different features and syntax. Convert unsupported constructs to JavaScript equivalents.

What does the g flag do?

The global flag allows the tester to enumerate matches throughout the input instead of stopping after one match.

Related tools