live regex · flag toggles · match highlighting

Test any JavaScript regex live

Type a pattern, toggle flags and watch matches highlight inside your sample text. Inspect every capture group and named group. Runs entirely in your browser.

Regex Tester
Matches
3
live
Groups
0
across all
Flags
g
1 on
Status
ready
78 B
Flags
input · pattern + sample
//g
output · matches
Contact alice@example.com or bob@test.org for details. Also try carol@demo.io.
3 matches
#1@8"alice@example.com"
#2@29"bob@test.org"
#3@64"carol@demo.io"
Quick Start

How to test a regex

Paste your pattern, toggle the flags you need, drop in some sample text — matches highlight live.

  1. 01

    Paste pattern

    Type or paste a regex into the pattern field — the /pattern/flags wrapper above mirrors what JavaScript actually executes. Validation runs as you type; an invalid pattern surfaces a precise syntax error inline.

    Patterns compile through the native ECMAScript RegExp constructor, so Unicode property escapes (\p{L}), named groups ((?<name>...)), and lookbehind all work — provided the u flag is on for property escapes.

    ECMAScriptRegExpUnicode escapesnamed groupsliteral
    input · patternECMAScript · live
    \b\w+@\w+\.\w+\b
    21 chars · 1 lineECMA-262 compatible
  2. 02

    Pick flags

    Toggle the seven ECMAScript flag characters individually. Each changes one semantic: g enables iteration with matchAll, i folds case, m anchors per-line, s lets . cross newlines, u unlocks proper Unicode, y is sticky, and d emits match indices.

    Combinations are non-trivial — gi is by far the most common, but gimsu on a multiline log line behaves very differently from gm alone. For a deep dive open the Flag Tester.

    g flagi flagm flags · u · y · dmatchAll
    config · flag setg · global iteration
    /pattern/gi
    2 flags on · liveECMA-262 § 21.2
  3. 03

    Drop sample text

    Paste sample text into the bottom field — every match highlights live, and the output panel lists positions, numbered capture groups, and named groups for each hit.

    Watch for catastrophic backtracking on nested quantifiers like (a+)+$ — a classic ReDoS source. Matches are capped at 100,000 to keep the page responsive on pathological inputs; suspect patterns can be vetted in the ReDoS Detector.

    capture groupsnamed groupshighlightReDoS-safepositions
    run · highlighted matches3 hits · 0 groups
    alice@x.com bob@y.io
    20 B · 1 linelive · capped at 100k
  4. 04

    Copy or export

    Copy a structured summary of every match — index, text, and capture groups — to your clipboard in one click, or download the report as a file for diffing against expectations.

    Clipboard writes go through navigator.clipboard.writeText; downloads use a local Blob and object URL, so nothing transits the network. Open DevTools to Network to confirm.

    clipboardblobexportreportprivacy-first
    export · clipboardmatch report
    Copied
    ready to ship0 outbound
Pro tips

Regex patterns that don't melt down

Use named groups

(?<year>\d{4}) reads better than $1 and survives reordering. Supported in ECMAScript 2018+.

Anchor strictly

Use ^/$ with the m flag when matching whole lines. Without anchors, partial matches sneak through.

Avoid catastrophic backtracking

Nested quantifiers like (a+)+ can explode. Run patterns through ReDoS Detector first.

Escape every literal

Backslash any meta character you want literally: \.\$\^\*\+\?\(\)\[\]\{\}\|\\.

Test edge cases

Empty string, single character, unicode, the maximum length you expect — write fixtures for each.

Patterns aren&rsquo;t parsers

Don’t parse HTML, JSON, or balanced parens with regex. Use a proper parser when the grammar is recursive.

Use Cases

When to reach for the tester

Authoring, debugging, validating regex on the fly.

Author a pattern

Iterate on a regex against realistic sample text. Compiles through the JavaScript RegExp constructor — engine quirks (Unicode property escapes, sticky matching, named groups) work when their flags are on. Error messages cite the exact position of any syntax issue.

ReDoS-safe

Debug failures

See exactly what your regex does and does not match. Pairs with the ReDoS detector to catch catastrophic backtracking before you deploy. A pattern that handles 1k-character input fine can become a denial-of-service vector on attacker-controlled 1M-character input.

ECMA-compliant

Inspect groups

Read out every numbered and named capture. Output exports as JavaScript, Python re, Java util.regex, .NET System.Text.RegularExpressions, PCRE, and POSIX — language quirks are highlighted on conversion so you don't ship a JS-only pattern to a Go service.

spec-grade

Compare flags

Toggle ignoreCase, dotAll, multiline to see the impact. Capture groups (named or numbered) round-trip cleanly into replacement strings, JSON output, or CSV extraction without re-typing. Backreferences ($1, ${name}) preserve semantics across languages.

cross-engine

Try ideas fast

No editor, no installs — just paste and try. Test against edge cases — empty input, single character, max length, multibyte boundaries — to catch off-by-one and zero-length match bugs before they reach production.

test-ready

Share findings

Copy the match summary to chat or a ticket. All matching runs client-side so secret patterns never leave the browser. Useful when the pattern itself is sensitive (PII regexes, internal data formats, security filters).

production-ready
FAQ

Frequently asked questions

JavaScript (ECMAScript) regex with full support for g, i, m, s, u, d and y flags.
Yes — (?<name>...) is supported and shown beside each match.
Matches are capped at 100,000 to keep the page responsive on pathological patterns.
An inline error replaces the output panel. Highlighting stops until the pattern is valid.
No. Everything runs locally in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!