Converters & Dev

Regex Tester

Write a pattern, paste some text, and see every match highlighted as you type — with capture groups listed and a replacement previewed. Nothing leaves your browser.

Pattern

Matches

Matches found
—
Capture groups
—

        
#MatchGroups

After replacing

What a regex tester is for

A regular expression is a small pattern language for finding things in text — an email address, a date, a price, a stray double space. Writing one is quick; being sure it matches what you meant is not. This page runs your pattern against real text as you type and shows exactly what it caught.

The flags

A quick reference

How to use the regex tester

  1. Type the pattern without the surrounding slashes — just \d{4}, not /\d{4}/g.
  2. Tick the flags you need, then paste your text. Matches are highlighted immediately.
  3. Add a replacement to see the rewritten text, using $1 and $2 for the captured groups.

Things to watch

Frequently asked questions

How do I test a regular expression?

Type the pattern without slashes, paste the text you want to search, and the matches are highlighted as you type. Capture groups are listed under each match.

What do $1 and $2 mean in the replacement?

They stand for the text captured by the first and second bracketed group in your pattern. Replacing (\w+)@(\w+) with "$1 at $2" turns rafi@softyfy into "rafi at softyfy".

Does this work for PHP or Python regex?

Mostly. The core syntax is shared, but each language has its own extensions. Anything using lookbehind, named groups or Unicode property escapes should be checked in the language you will run it in.