Text

Regex Tester

Test a regular expression against sample text and see every match highlighted, with capture groups — runs entirely in your browser.

LogShare Regex Tester Runs in your browser · nothing is uploaded

Loading tool…

About the Regex Tester

Paste a pattern and some test text to see every match highlighted in place, plus a list of matches with their capture groups and positions. Uses your browser’s native JavaScript regex engine, so behavior matches what your JS code will actually do.

How to use the Regex Tester

  1. Enter a pattern (without the surrounding slashes).
  2. Choose flags — g, i, m, s — as needed.
  3. Paste your test text.
  4. Matches are highlighted inline, with a list of capture groups below.

Step-by-step walkthrough with examples and the errors people hit: How to Test a Regex with Capture Groups.

Example

Pattern

\b\w+@\w+\.\w+\b  (flags: g)  on "contact ada@example.com or grace@example.org"
2 matches: ada@example.com, grace@example.org

Common errors and how to fix them

The match grabs far too much

Quantifiers are greedy by default: .* runs to the last possible character. Use the lazy form .*? or a negated class such as [^,]* to stop at the first delimiter.

^ and $ do not match each line

Add the m flag. Without it the anchors apply to the whole text.

More problems and fixes in the tutorial

FAQ

Which regex flavor does this use?

JavaScript’s native RegExp engine — the same one your browser or Node.js code uses, so results transfer directly.

Why does my pattern throw an error?

The pattern isn’t valid JavaScript regex syntax — the tool shows the exact SyntaxError message from the engine.

Is my test text uploaded anywhere?

No, matching runs entirely in your browser.