Regex Tester

//g
Common patterns

Quick reference

\ddigit
\wword char
\swhitespace
.any char
+1 or more
*0 or more
?optional
[abc]char set
^line start
$line end

What Is a Regex Tester?

The Regex Tester lets you build and debug regular expressions with instant feedback. Type a pattern and choose the flags (global, ignore-case, multiline, dotall), paste your test text, and every match is highlighted live as you type, with a running match count. It also lists numbered and named capture groups from the first match and includes a library of ready-made patterns — email, CPF, CEP, Brazilian phone, URL, IPv4 and dates — plus a quick reference of the most common syntax tokens. Everything uses your browser’s native JavaScript regex engine and runs locally, so your patterns and text stay private.

A regular expression (regex) is a sequence of characters that defines a search pattern. Regex testers let you write an expression and immediately see which parts of a text it matches, making it far easier to build and debug patterns before embedding them in code. Without an interactive tester, you must edit a script, run it, read output and repeat — a loop that a regex tester collapses into milliseconds.

How to Use the Regex Tester

  1. Type a regular expression and toggle the flags (g, i, m, s) you need.
  2. Paste text below — matches are highlighted instantly with a count.
  3. Inspect the capture groups, or click a common pattern to start from a template.

Use Cases

  • Writing and testing an email or phone number validation pattern before adding it to a form.
  • Finding and extracting specific data from a log file, API response or large text block.
  • Checking that a search-and-replace pattern captures exactly the intended text before running it in an editor or script.
  • Learning regex syntax by experimenting with a live pattern and seeing results in real time.

How Regex Matching Works in JavaScript

This tool uses JavaScript's native RegExp engine (the same one that runs in Node.js, Chrome and Firefox). You enter a pattern and optional flags (g for global, i for case-insensitive, m for multiline, s for dotAll), and the engine tests the pattern against your input string using matchAll() to collect all matches and their positions.

Each match highlights the start and end indices in the test string. Capture groups — text inside parentheses — are shown separately, which is essential for extracting specific parts of a match, like the domain from an email address or the year from a date string.

Benefits and Use Cases

  • Build and debug patterns for validation, parsing and search-and-replace in seconds.
  • Learn regex faster with live highlighting, group inspection and a built-in cheat sheet.
  • Runs entirely in your browser, so your patterns and test data are never uploaded.

Privacy

Pattern matching happens entirely in your browser's JavaScript engine. The regex patterns and test strings you enter are never sent to our servers.

FAQ

Which regex flavor is used?

It uses the JavaScript (ECMAScript) regular-expression engine in your browser, including named groups and the g, i, m and s flags.

Is my test text sent anywhere?

No. Matching runs entirely in your browser — nothing is uploaded.

Can I see capture groups?

Yes. The tool lists both numbered and named capture groups from the first match.

What regex flags does this tool support?

The tool supports all standard JavaScript flags: g (global — find all matches, not just the first), i (case-insensitive), m (multiline — ^ and $ match start/end of each line), s (dotAll — dot matches newline), u (unicode) and d (generate match indices). Combine flags freely, e.g. gi for case-insensitive global search.