Regex Tester

Test and debug regular expressions with live match highlighting.

/ /
Quick:

What is the Free Regex Tester?

The free Regex Tester lets you write, test, and debug regular expressions in real time with live match highlighting. Type your pattern into the pattern input between the forward slashes, toggle your flags using the g / i / m / s buttons, paste your test string — and every match is highlighted in yellow instantly. The Matches table shows each match with its character index and capture group values. Replace mode lets you preview substitutions before using them in your code.

  • Test and validate regex patterns before adding them to production code
  • Extract emails, URLs, phone numbers, or dates from text using one-click quick patterns
  • Debug capture groups to see exactly what each group is matching
  • Preview regex replacements — sanitising input, reformatting strings — without touching your code
  • Learn regular expression syntax interactively by experimenting with patterns

How to Use the Free Regex Tester

  1. 1 Type your regular expression into the input field between the / / delimiters.
  2. 2 Set flags using the toggle buttons: g (global, find all matches), i (case-insensitive), m (multiline — ^ and $ match each line), s (dotAll — dot matches newlines).
  3. 3 Or click a Quick pattern chip — Email, URL, IPv4, Date, Phone, or Hex colour — to load a ready-made pattern.
  4. 4 Paste your test string into the Test String textarea. Every match is highlighted in yellow in the Match Preview below the textarea.
  5. 5 Expand the Matches table to see each match's text, character index, and any capture group values.
  6. 6 Click ▸ Replace mode to enter a replacement string and preview the full find-and-replace result.

Key Features

  • 🟡
    Live match highlighting
    Every match is highlighted in yellow in the test string as you type your pattern.
  • 📋
    Matches table
    Lists every match with its character index and the value of each capture group.
  • 🔄
    Replace mode
    Enter a replacement string and preview the result of a global find-and-replace.
  • Quick-start patterns
    One-click chips for Email, URL, IPv4, Date, Phone number, and Hex colour patterns.
  • 🚩
    Flag toggles
    Toggle g, i, m, s flags with dedicated highlighted buttons — no need to remember the syntax.

Example Usage

Example Input
Pattern: \b[A-Z][a-z]+\b
Test: Hello World, this is a Regex Test.
Example Output
Matches: Hello (0), World (6), Regex (26), Test (32) — 4 matches

Frequently Asked Questions about the Free Regex Tester

What is the free Regex Tester?
Test and debug regular expressions with live match highlighting.
Is the Regex Tester free to use?
Yes, the Regex Tester is completely free. No account, subscription, or signup is required — ever.
Does my data get uploaded anywhere?
No. The Regex Tester runs entirely in your browser. Your data is never sent to any server.
Does it work offline?
Yes. Once the page has loaded, the tool works without an internet connection.
Which browsers are supported?
All modern browsers — Chrome, Firefox, Safari, and Edge. No plugins or extensions required.
What regex flavour does this tool use?
This tool uses JavaScript's native RegExp engine. It supports character classes, quantifiers, groups, non-capturing groups, lookaheads, lookbehinds (in modern browsers), and named capture groups (?<name>...). It differs slightly from PCRE (used in PHP and Python) — particularly around some lookahead and Unicode features.
Why does my regex only match once even though I set the g flag?
Make sure the <strong>g</strong> (global) toggle button is highlighted/active. Without the global flag, the engine stops after the first match. You can also type g directly into the flags text box next to the pattern input.
What is the difference between the m and s flags?
The <strong>m</strong> (multiline) flag changes ^ and $ to match the start and end of each individual line rather than the whole string. The <strong>s</strong> (dotAll) flag makes the dot . match newline characters (\n, \r) as well — useful when your pattern needs to match content that spans multiple lines.

Related Free Developer Utilities