Skip to main content
PixelTools

Regex tester

Test a regular expression and see every match and capture group. Free, private — nothing leaves your browser.

0 characters
Matches highlighted

Enter a pattern and some text to see the matches.

Everything you need to test a regex

Live match highlighting

Every match is marked in your text as you type, so you see what the pattern really catches.

Capture groups listed

Each match shows its position, numbered groups and named groups.

Common flags

Switch global, ignore case, multiline, dot-all and unicode on or off with a tick.

Clear error messages

A pattern with a syntax error says what is wrong instead of failing silently.

100% private

Runs entirely in your browser. Nothing you type is uploaded or stored.

Copy the matches

Copy every matched string, one per line, ready to paste elsewhere.

Test a regex in three steps

  1. 1

    Enter your regular expression

    Type the pattern without slashes, for example \d{3}-\d{4}, and tick the flags you need.

  2. 2

    Paste the text to test

    Add the sample text. Every match is highlighted as you type, and a syntax error shows straight away.

  3. 3

    Read the matches and groups

    The match list shows each result with its position and capture groups. Copy the matches when you are done.

Built for validation, search and cleanup

A regex tester shows what a pattern really matches before you put it in code. Every match is highlighted in your sample text, with its capture groups listed below.

Checking a pattern before you ship it

Confirm a validation regex accepts what it should and rejects what it should not.

Pulling data out of logs

Find IDs, timestamps or error codes in a block of log output.

Learning regular expressions

Change a pattern one character at a time and watch the highlighted matches update.

Extracting capture groups

See exactly which part of a match each group captured before you use it in code.

Frequently asked questions

How do I test a regular expression online?

+

Type your pattern in the regex box, paste sample text in the box below and tick the flags you want. The tool highlights every match and lists its capture groups, with no button to press.

Which regex flavour does it use?

+

JavaScript (ECMAScript), the engine built into your browser. Lookahead, lookbehind, named groups and the u and s flags work. Features from other flavours, such as PCRE's possessive quantifiers or Python's (?P<name>), do not.

Is my text uploaded anywhere?

+

No. The pattern runs in your browser. Nothing you type is sent to a server or stored, so it is safe to use on logs and private data.

What do the flags mean?

+

g finds every match instead of the first, i ignores case, m makes ^ and $ match at each line, s lets the dot match line breaks, and u turns on full Unicode matching.

Why does the page freeze on some patterns?

+

A few patterns, such as (a+)+$ on a long run of a's, cause catastrophic backtracking and can take very long in any browser. If the page stops responding, close the tab and simplify the pattern.

Does it replace text or step through the match?

+

No. This tool finds and highlights matches and capture groups. It does not do search-and-replace, a step-by-step debugger or saved pattern libraries.

Test your regex now

Free, no account needed.