100% offline
Developer
Free · no signup
Updated

Regex Tester

A Regex Tester evaluates a regular expression against a sample string in real time, highlighting every match and capture group, all using the browser's native RegExp engine so your pattern and test data never leave the page.

//g
Flags
Test string
Highlighted matches
Enter a pattern and a test string.

About Regex Tester

Type a pattern in the slash-delimited box, set flags (g, i, m, s, u, y) with toggle buttons, and paste a test string. Matches are highlighted inline and listed with their index and any capture groups in a table. The tester also surfaces the SyntaxError message verbatim when a pattern is invalid so you can fix it immediately.

What Regex Tester does

  • Real-time match highlighting against your test input
  • All ECMAScript flags exposed as toggle buttons (g, i, m, s, u, y)
  • Capture groups and named groups listed in a sortable table
  • Surfaces SyntaxError messages verbatim for broken patterns
  • Debounced input for smooth typing on megabyte-scale test strings

When to reach for Regex Tester

  • Authoring a validation regex for a form field
  • Extracting structured data out of log lines
  • Debugging why a production regex never matches
  • Translating a regex you found in a Stack Overflow answer into something you understand

How to use Regex Tester

  1. 01

    Enter your pattern

    Type the regex between the slashes. Toggle any flags (g, i, m, s, u, y) as needed.

  2. 02

    Paste a test string

    Paste any text into the test input — matches highlight live as you type.

  3. 03

    Inspect captures

    Each match and its capture groups appear in a table you can copy individually or all at once.

When to use Regex Tester vs alternatives

AlternativeUse Regex Tester when…Use the alternative when…
regex101.comyou want a pattern tested 100% locally with no third-party logging.you need PCRE / Python / Go regex flavors or detailed step-by-step explanations.
Browser console RegExpyou want match highlighting and capture-group tables for free.you only need to test one or two simple patterns.

Frequently asked questions

Which regex flavor does this support?
ECMAScript / JavaScript regex via the native RegExp constructor. That means PCRE-only features (lookbehind back-references, named groups with PCRE syntax, possessive quantifiers) won't work, but lookahead, lookbehind, named groups, and Unicode property escapes (with the u flag) do.
Does it work with very long input?
Yes. We use matchAll with the g flag to enumerate matches lazily, and we debounce the input by 150ms so typing stays smooth even with megabyte-scale test strings.
How do I match across newlines?
Enable the s (dotAll) flag — that makes the dot metacharacter match newline characters. The m flag changes the meaning of ^ and $ to anchor on each line rather than the whole string.
Can I copy the matches?
Yes. Each match row has a copy button, and you can copy the full match list as JSON.

Related concepts