Skip to content
Dev

Regex Tester

An in-browser JavaScript regex tester. Enter a pattern, flags, and haystack text to highlight matches and list capture groups. Processing stays on the device. It uses the browser's RegExp engine, not PCRE or .NET.

JavaScript source, without surrounding slashes. Example: (\\w+)@(\\w+\\.\\w+)

Flags

Common JS flags: g, i, m, s, u, y. Matching uses this browser’s RegExp, not PCRE or .NET.

The haystack. Matches update as you type and stay on this device.

Matches

2 matches · flags g.

Highlight

Ada <ada@example.com> and Lin <lin@tools.dev>
Order 1042 is not an email.

Capture groups

  1. Match 1

    ada@example.com

    Index 5 · length 15

    Group 1
    ada
    Group 2
    example.com
  2. Match 2

    lin@tools.dev

    Index 31 · length 13

    Group 1
    lin
    Group 2
    tools.dev

Frequently asked questions

Which regex flavor is this?

JavaScript (ECMAScript) via your browser's RegExp. It is not PCRE, Python, or .NET.

Are my strings uploaded?

No. Matching runs locally. The pattern and sample text stay in your browser.

What flags can I use?

Common JS flags: g, i, m, s, u, y. Global finds every match, i ignores case, m lets ^ and $ match line edges, s lets a dot match a newline, u turns on Unicode mode, and y (sticky) matches only at the current index.

Why did my pattern error?

Invalid syntax throws a browser RegExp error. Check unescaped slashes or unfinished groups. The message in Matches is the engine error itself.

Can I replace matches?

This version tests and lists matches. Substitution can be added later.