Free Regex Tester

Test a regular expression against sample text, with live highlighting and capture groups, entirely in your browser.

/ /

How to test a regular expression

  1. 1

    Write your pattern

    Enter a regular expression in the pattern field, and any flags (like g, i, m) in the flags field.

  2. 2

    Paste your test string

    Enter the text you want to check the pattern against.

  3. 3

    Review the matches

    Matches are highlighted inline and listed below with their position and any capture groups.

Example use cases

1

Validating input patterns

Check that a pattern for emails, phone numbers, or usernames matches valid input and rejects invalid input before shipping it.

2

Extracting data from text

Prototype a pattern for pulling structured values (IDs, dates, URLs) out of logs or unstructured text.

3

Debugging an existing regex

Paste in a regex from code that isn't matching as expected and see exactly which parts of your test string it does and doesn't catch.

Frequently asked questions

Which regex flavor does this use?

This tool uses JavaScript's native RegExp engine, since it runs entirely in your browser — syntax is very close to PCRE but has some differences, such as no full support for lookbehind in older browsers and slightly different Unicode handling.

What do the flags mean?

Common flags: g finds all matches instead of stopping at the first, i makes matching case-insensitive, m treats ^ and $ as matching line starts/ends, and s lets . match newlines.

Why do I see capture groups listed under each match?

Any parenthesized group (...) in your pattern captures part of the match — each is listed by index (and by name, for named groups like (?...)) under its match.

Is my text sent anywhere?

No. Matching happens locally in your browser using JavaScript — nothing you type is sent to a server.