Skip to content
Motifuse
Free browser tool
Developer

Regex Tester

Test JavaScript regular expressions against sample text with live match highlighting, capture groups, match counts, and flag controls.

  • Free public tool
  • No sign-up for this tool
  • Processing clearly labeled
  • Instant results

Content last reviewed

60 characters · 1 lines

2 matches

Contact us at hello@motifuse.dev or sales@example.com today.

Overview

Run the browser's JavaScript regex engine against representative text

Enter a RegExp pattern, select flags, and inspect non-overlapping matches with numbered capture groups. The loop guards against zero-length global matches, but evaluation is synchronous and a pathological backtracking pattern can still make the tab unresponsive.

Browser JavaScript syntax

Patterns are compiled with new RegExp, so support follows this browser rather than PCRE, Python, Java, or .NET.

Six accepted flags

The flag field accepts g, i, m, s, u, and y; quick toggles cover g, i, m, and s.

Highlighted non-overlapping matches

Every global result—or the first result without g—is marked in the original test string.

Numbered capture output

Captured values from each match are listed as $1, $2, and so on.

How it works

Using Regex Tester, start to finish

Three steps, in the order the tool above actually takes them.

  1. 1

    Enter the pattern

    Use JavaScript RegExp source without surrounding slash delimiters.

  2. 2

    Set flags and test text

    Choose global, case, multiline, dotall, Unicode, or sticky behavior as the target runtime requires.

  3. 3

    Review matches and groups

    Check boundaries and negative examples, then retest the final pattern in the application runtime.

Use cases

What people bring here

The jobs this page is usually opened for, and the setting that makes each one quick.

Extracting a repeated token

Use the global flag to locate every non-overlapping occurrence in a representative sample.

Include strings that should not match; positive examples alone encourage patterns that are too broad.

Debugging anchors and lines

Compare ^ and $ with and without the multiline flag over actual multi-line input.

Dotall changes dot behavior; multiline changes anchors. They solve different problems.

Reviewing capture groups

Confirm which subexpressions populate numbered groups for each match.

This interface lists numbered captures; test replacement syntax and named groups in the destination code separately.

A pattern belongs to a runtime

Syntax portability and input performance both need target-environment tests

Similar-looking regex flavors diverge at advanced features, and some nested alternatives grow dramatically on near-matching input. A browser success is evidence for this JavaScript engine only.

Flavor

A JavaScript match guarantees Python, PHP, or .NET behavior.

Compile and test the pattern with the target engine and version.

Global flag

g changes what one match means.

It continues the scan for non-overlapping matches and makes RegExp stateful in application code.

Greediness

.* always stops at the nearest delimiter.

It is greedy; use a lazy quantifier or a delimiter-excluding class when that reflects the grammar.

Backtracking

A quick short sample proves the pattern is safe on long hostile input.

Test size and near-miss cases, bound input, and avoid ambiguous nested repetition.

Privacy

Where your work is processed

The pattern and test text are compiled and matched in this tab. Neither is uploaded or autosaved.

Source content stays in the tab

Encoding, parsing, formatting, generation, comparison, and cryptographic operations run in browser code. Form values and uploaded text files are not sent to a processing API.

Inputs are not autosaved

Code, tokens, secrets, URLs, and generated outputs stay in component memory until the page reloads or closes. Split-pane tools remember only the divider percentage for the current tab session.

Clipboard and downloads are explicit

The page reads the clipboard only after a Paste action and writes it only after Copy. A local download is created only when you choose the tool's download control.

One aggregate page view may be counted

The page shell can send the tool slug, never the editor contents or filename. The endpoint is rate-limited using a transient requesting address and is skipped for Do Not Track or Global Privacy Control.

More detail in how processing works and our privacy policy.

Limits

Tester behavior

The values this tool actually enforces, not a rounded-up version.

Engine
JavaScript RegExp
Feature support follows the active browser.
Accepted flags
g i m s u y
Duplicate or invalid flag sequences surface as pattern errors.
Match mode
All with g
Without g only the first match is returned.
Execution
Synchronous
No timeout or worker isolates pathological patterns.

No PCRE modes, replacement preview, explanation engine, or execution timeout

JavaScript regular expressions only, as implemented by your browser. There is no PCRE, Python or .NET mode, no replacement preview, and no explanation of what a pattern means — it shows what a pattern does against the input you supply. Very large inputs combined with a catastrophically backtracking pattern can block the tab, because matching is synchronous.

FAQ

Regular-expression testing questions

The ones that actually come up.

Guides

Reading that goes deeper

Find this useful? Share it.