Regex Tester

Last updated: 2026-06-25

TL;DR

The regex tester is a free tool that highlights matching parts of a test string in real time as you enter a pattern and flags, and shows the match count and groups.

It uses the browser's JavaScript regular expression engine, and your input is never sent to a server.

Test a regex

How to use

  1. Enter a pattern — type the regex pattern to test without slashes (e.g. \d+).
  2. Choose flags — enter the flags you need, such as g (global), i (ignore case) or m (multiline).
  3. Review the result — matching parts of the test string are highlighted and the match count and groups are shown.

Regex flags and basic syntax

A regular expression (regex) is a small language for describing patterns in strings. It is used for searching, replacing and input validation (email, phone numbers), and flags adjust how matching works.

Common regex flags
FlagMeaningDescription
gglobalFinds all matches (does not stop at the first)
iignoreCaseCase-insensitive matching
mmultiline^ and $ match start and end of each line
sdotAll. also matches line breaks
uunicodeProcesses by Unicode code point

For example, \d+ matches one or more digits, [a-z]+ a run of lowercase letters, and \b a word boundary. Capture groups (...) extract parts. To organize match results as JSON, use the JSON formatter.

Frequently asked questions (FAQ)

Which regex syntax is supported?

It uses the browser's JavaScript regular expression engine (ECMAScript RegExp). So you can test any pattern, flags (g, i, m, s, u, y), capture groups, lookaheads and more that work in JavaScript.

What does the g flag do?

The g (global) flag does not stop at the first match but finds every match in the whole string. Without g, only the first match is returned. This tool applies g behavior internally so it can show all matches.

How is an invalid pattern shown?

If the regex syntax is invalid, the error message thrown by JavaScript is shown. You can immediately spot syntax errors such as unclosed parentheses or invalid quantifiers.

Is the text I enter sent to a server?

No. The pattern and test string are processed entirely in the browser and are never sent to or stored on a server.

Last updated: 2026-06-25