Regex Tester

Test regular expressions online and see every match and capture group live — free regex tester.

Flags

About

About the Regex Tester

Runs a regular expression against sample text and lists every match, its position and its capture groups.

Developers use it to build and debug a pattern before dropping it into code, while data analysts use it to check that a pattern captures the right groups from messy text before writing a full extraction script. It's one of many free developer tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.

Choose what to view about this tool

Guide

Using the Regex Tester

  1. 1

    Step 1

    Type your regular expression into the Pattern field, without the surrounding slashes.

  2. 2

    Step 2

    Toggle the flags you need: global, ignore case, multiline, dot matches newline.

  3. 3

    Step 3

    Paste the text you want to test against into the Test text box.

  4. 4

    Step 4

    Click "Run test" to see every match, its index and its capture groups.

  • Uses JavaScript's native RegExp engine, so results match what your code will actually do
  • Toggle global, ignore-case, multiline and dot-matches-newline flags independently
  • Lists every match with its exact character index in the text
  • Shows every capture group's value for each match, numbered
  • Guards against catastrophic patterns by capping results at 5,000 matches
  • Works entirely in your browser — nothing you type is sent to a server
  • Free to use, with no sign-up and no limit on how many times you run it

Developers

Developers use the Regex Tester for building and debugging a pattern against real sample text before dropping it into their code.

Data analysts

Data analysts use the Regex Tester for checking that a pattern captures the right groups from messy text before writing a full extraction script.

QA engineers

QA engineers use the Regex Tester for verifying a validation pattern matches (or correctly rejects) a set of edge-case inputs.

Students learning regex

Students learning regex use the Regex Tester for seeing immediately how a pattern and each flag actually behaves against real text.

Examples

Regex Tester examples

3 worked examples

01

Extracting email addresses

Set Pattern to \b\w+@\w+\.\w+\b with the global flag on, paste "Contact us at info@example.com or sales@example.com", and Run test lists both addresses with their index (14 and 34) and full match.

02

Capturing groups from a date

Use pattern (\d{4})-(\d{2})-(\d{2}) against "2026-09-28" to get one match with three capture groups: 2026, 09 and 28.

03

Case-insensitive matching

Search for "hello" with the ignore case flag on against "Hello there, HELLO again" to match both — Hello at index 0 and HELLO at index 13 — despite the different capitalization.

FAQ

Frequently asked questions

Quick answers to common questions about the Regex Tester.

What does the Regex Tester do?

It runs a regular expression against sample text and lists every match, its position, and its capture group values.

Is the Regex Tester free to use?

Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.

Is my pattern and text safe when I use this tool?

Yes. Matching happens entirely in your own browser using JavaScript's built-in RegExp engine — nothing you type is sent to a server.

What do the four flags do?

Global finds every match instead of stopping at the first. Ignore case matches letters regardless of case. Multiline makes ^ and $ match the start and end of each line rather than the whole string. Dot matches newline makes the . token also match line-break characters.

Why does the tool always add the g flag internally?

It needs the g flag to step through and collect every match. If you turn "global" off, the tool still scans but stops after the first match, matching what a non-global regex would find.

What happens with a pattern that matches an empty string?

The tool automatically advances past a zero-length match so it doesn't get stuck in an infinite loop, and still reports it as a match.

Is there a limit on how many matches it will show?

Yes, it stops at 5,000 matches to keep the page responsive, and tells you if it stopped early.

Can I use the Regex Tester on my phone?

Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.

Still have a question? Contact us

Report a problem

Regex Tester

What went wrong?
    or paste a screenshot