Regex Tester

Test and debug regular expressions against your text in real time, with match highlighting and capture groups. Everything runs in your browser — your data is never sent anywhere and nothing is stored.

How to use the regex tester

  1. Type your pattern in the Regular expression box (no surrounding slashes needed).
  2. Set the flags — g for all matches, i for case-insensitive, m for multiline.
  3. Paste your test string below and watch matches highlight and the count update as you type.
  4. Check the capture groups of the first match to see what each (…) captured.

Handy tokens: \d a digit, \w a word character, \s whitespace, . any character, * zero or more, + one or more, ? optional, [...] a character class and (...) a capture group.

More PAYATE tools

Frequently asked questions

What is a regular expression?

A regular expression (regex) is a pattern that describes a set of strings. It lets you search, match, validate and extract text — for example finding all email addresses in a document or checking that a value looks like a phone number.

Which regex flavor does this tester use?

This tool uses the JavaScript (ECMAScript) regex engine built into your browser via new RegExp(pattern, flags). Most syntax is portable, but details such as lookbehind, named groups and some escapes can differ from PCRE, Python or .NET flavors.

What do the flags g, i and m mean?

The g (global) flag finds all matches instead of stopping at the first. The i (ignoreCase) flag makes matching case-insensitive. The m (multiline) flag makes ^ and $ match at the start and end of each line rather than the whole string. You can combine them, e.g. gim.

Why is my regex invalid?

A regex is invalid when its syntax is malformed — for example an unclosed group ( or character class [, a dangling \, an unmatched ), or an unknown flag. The tester shows the browser's exact error message in red so you can fix it.

Are matches case sensitive?

By default, yes — matching is case sensitive. Add the i flag to the flags box to match regardless of case, so that abc also matches ABC and Abc.

Is my data sent anywhere?

No. Matching runs entirely in your browser — your pattern and test text are never uploaded to a server and nothing is stored. It is safe for data you would not want to transmit.