Skip to content

Developer & Security

Regex Tester

Write a regex pattern and instantly see which parts of the text match, which groups are captured, and the result of a replacement. Common example patterns for email addresses, phone numbers and URLs are included.

Free · no sign-up · runs in your browser · updated

Use Regex Tester

Flags

How to use Regex Tester

  1. Type a regex pattern and choose the flags you need (g, i, m, s, u, y).

  2. Paste your test text. Matches are highlighted and the list of capture groups is shown.

  3. Fill in the replacement box to see the replaced result, then copy the pattern into your code.

Basic regex syntax

\d matches one digit, \w one letter, digit or underscore, and \s one whitespace character. The + sign means one or more, * zero or more, ? optional, and {n,m} a specific count. Parentheses ( ) create a capture group, [abc] is a character set, and ^ and $ mark the start and end. Example: \d{4}-\d{2}-\d{2} matches a date such as 2026-10-26.

The JavaScript regex engine

This tool uses your browser’s built-in regex engine (ECMAScript), so results match what runs in JavaScript and Node.js. Other languages such as PHP, Python or Java differ slightly in syntax, for example for lookbehind and named groups. Very complex patterns can run slowly (catastrophic backtracking); this tool runs them in a separate worker and stops them after about two seconds.

Questions about Regex Tester

What do the flags g, i, m, s, u and y mean?

g: find all matches, not just the first. i: ignore case. m: ^ and $ apply per line. s: the dot also matches line breaks. u: full Unicode support. y: match only from a specific position (sticky).

How do I use capture groups in a replacement?

In the replacement box, $1, $2 and so on refer to the first, second and later groups. $& is the whole match. Named groups are referenced with $<name>.

Why was my pattern stopped for taking too long?

Patterns with nested repetition such as (a+)+ can hit exponential backtracking on certain text. Simplify the pattern or avoid nested quantifiers.

Can I use patterns from this tool in other languages?

Most basic patterns work, but advanced features such as lookbehind or named groups differ between languages. Test again in your target language.

Is my test text sent to a server?

No. Testing runs in your browser.

Need more than tools?

We build websites, apps, and custom systems for your business.

These tools are only a small part of what Tipamedia can build. Tell us what you need and we will help you work out the next step.