Regex Tester

Test regular expressions live — highlighted matches, capture groups and flags.

//

Runs in your browser — your data never leaves your device.

About the Regex Tester

Build and debug regular expressions with instant feedback. Every match in your test text is highlighted, and a table lists each match with its position and capture groups. Syntax errors are explained as you type.

The tester uses JavaScript regular expressions, which are very similar to those in PHP (PCRE), Python and most editors.

How to use the Regex Tester

  1. Type your pattern between the slashes (without the slashes themselves).
  2. Tick the flags you need: g for all matches, i to ignore case, m for multi-line ^ and $, s so the dot matches new lines, u for full Unicode.
  3. Paste test text and read the highlighted matches and the table.

How it works

The pattern is compiled with JavaScript's RegExp. With the g flag, matching repeats from the end of each match (empty matches advance by one character) up to 1,000 matches. The first 200 matches are listed with their capture groups.

Examples

  • \b03\d{2}-\d{7}\b finds Pakistani mobile numbers like 0300-1234567.
  • ^\s*$ with the m flag finds empty lines.

Frequently asked questions

Is my text sent to your server?

No. Everything runs in your browser, on your own device. Nothing you type or paste is uploaded or stored.

Why does my pattern freeze the page?

Some patterns with nested repetition, like (a+)+, can take extremely long on certain text (“catastrophic backtracking”). Simplify the pattern or make the repeated parts more specific.

Category: Developer Tools · Free to use · Last updated Oct 8, 2026