kernos/

Regex Tester

test-string.txt
Loading editor…
Ln 1, Col 11 lines0 chars
terminal
$regex-tester
Buy me a coffee

About Regex Tester

Regex Tester lets you write a JavaScript regular expression and see every match against your sample text live, highlighted directly in the editor, with each match's index and captured groups broken out alongside it. Matching uses the browser's native RegExp engine — the exact same engine your JavaScript code would use — so what you see here is what you'll get in production. Nothing you type is ever sent to a server.

How to use it

  1. 1

    Write your pattern

    Type a regular expression into the pattern field (without surrounding slashes) and set any flags you need, like i for case-insensitive or m for multiline.

  2. 2

    Paste sample text

    Paste the text you want to test into the test-string pane. Matches are highlighted inline as you type, in both the pattern and the text.

  3. 3

    Inspect matches

    The matches panel lists every match with its position and any captured groups (numbered or named). Click Copy Matches to copy the full match data as JSON.

What it does

FAQ

Which regex flavor does this use?

JavaScript's native RegExp engine, the same one used in browsers and Node.js. Syntax and behavior may differ slightly from PCRE, Python's re, or other engines — for example, lookbehind support depends on the flags and engine version.

Why do I need to add the 'g' flag?

You don't — global matching is applied automatically so every match in your text is found, regardless of which flags you set. Add other flags like i (case-insensitive), m (multiline), or s (dot matches newline) as needed.

Why does my pattern only match part of what I expect?

This usually means the pattern is more specific than intended, or a quantifier is greedy vs. lazy in a way that changes what gets consumed. Check the matches panel — each match's captured groups often reveal exactly where the pattern is splitting the text differently than expected.

Can a pattern freeze the tab?

Certain patterns with nested, ambiguous quantifiers (catastrophic backtracking) can make matching extremely slow against long input. If a tab becomes unresponsive, simplify the pattern or shorten the test string.

Related tools