1. Home
  2. Coding Tools
  3. Regex Tester

Regex Tester

Write and test JavaScript regular expressions with live match highlighting, capture groups, flags and a quick reference cheat sheet.

Highlighted matches
Match details
Regex cheat sheet
.  any character      \d digit      \w word char     \s whitespace
^  start of line      $  end        \b word boundary
*  0 or more          +  1 or more   ?  optional       {2,5} range
[abc] any of a,b,c    [^abc] none of   (x) capture group  (?:x) non-capturing
a|b  a or b           (?<name>x) named group        (?=x) lookahead
Flags: g global · i ignore case · m multiline · s dotAll · u unicode

Runs locally in your browser. Your files and data are never uploaded or stored.

About the Regex Tester

Regular expressions are powerful patterns for searching, validating and transforming text, but they are notoriously hard to get right. The Regex Tester shows every match highlighted in your test text as you type, so you can build and debug patterns step by step.

It uses the JavaScript regular expression engine, the same one used in browsers and Node.js, and supports all flags including global, case-insensitive, multiline, dotAll and unicode. The match details panel lists each match with its position, numbered capture groups and named groups. A built-in cheat sheet reminds you of the most common tokens. Use it to validate email addresses, phone numbers, postcodes, extract data from logs or prepare find-and-replace operations.

How to use the Regex Tester

  1. Enter your regular expression pattern (without slashes).
  2. Set flags such as g, i or m.
  3. Paste the text you want to test.
  4. Review highlighted matches and capture groups.

Frequently asked questions

Which regex flavor does this use?

JavaScript (ECMAScript). Most syntax is shared with PCRE, Python and Java, but some features like lookbehind support and possessive quantifiers differ.

Why do I need to escape backslashes?

In this tester you type the raw pattern, so write \d, not \\d. Double escaping is only needed inside string literals in code.

What does the g flag do?

The global flag finds all matches instead of stopping at the first one.