Regex Tester

Test a regular expression and see every match and group.

Also called: regular expression tester, regex checker.

FreeNo sign-upRuns in your browser
DEVELOPER

Regex Tester

Test a regular expression and see every match and group.

Runs locally in your browser
Ready. Fill in the fields above, then press Run tool.
Privacy note: this tool runs in your browser, so the text you enter stays on your device.

Find a tool

Loading tools…

Watch: how to use the Regex Tester (13 seconds)

Recorded on a phone, steps written on screen, no sound.

About the Regex Tester

Type a regular expression and its flags (g, i, m, s, u) and paste test text to see every match and its groups. It uses JavaScript's regex engine, the same as browsers and Node.js.

Example: the pattern \d{3}-\d{4} with the g flag finds every number like 555-1234.

Other languages (Python, PHP, Java) are very similar but differ in some features, such as look-behind and named groups.

How to use the Regex Tester

  1. Add your inputFill in pattern, flags and test text. An example is already filled in, so you can press Run tool first to see how it works.
  2. Press Run toolThe result appears right under the button.
  3. Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.

This tool works inside your browser: what you enter stays on your device.

Example

The result the Regex Tester gives for a short sample note that contains a date, an e-mail address, a web address, a phone number and prices (produced by the tool itself).

Pattern
\+92 \d{3} \d{7}
Flags
g

Result:

1 match(es)

#1 at 121: "+92 300 1234567"

Good to know

What you need
You type or choose: Pattern, Flags, Test text
Where it runs
In your browser, on your device.
Cost
Free, no sign-up.

Questions

What does the g flag do?

Finds every match instead of only the first.

Why no matches?

Check escaping: a literal dot is \. and a backslash is \\.

Is my text sent anywhere?

No, it runs in your browser.

More tools in Developer

See all Developer tools