Start 中文

Online tool · No install

Regex Tester

Write a pattern, paste text below, and matches, capture groups and a replacement preview light up instantly — powered by the same JavaScript RegExp engine your code uses.

Input

Live result

Matches

How it works

Type a pattern (no surrounding slashes needed) and tick the flags: g global, i ignore case, m multiline, s dotall, u Unicode, y sticky. Paste text into the Test string box — matches highlight live and the table lists each position and capture group.

Flags cheatsheet

FlagMeaning
gFind all matches, not just the first
iCase-insensitive
mMake ^ $ match line starts/ends
sLet . also match newlines
uUnicode code points — better with emoji
ySticky: start exactly at lastIndex

FAQ

Is this the same regex as elsewhere?

This page uses the browser’s built-in JavaScript RegExp, identical to what you write in frontend or Node code. It does not support some backend-only dialect features, so check your target language when porting.

Why does it stop at the first match?

Without g, exec/match return only the first match. Tick g to list them all.

What are $1 in the replacement?

$1–$9 reference capture groups, $& the whole match. Tick “Show replacement preview” to see the result.

Is my text uploaded?

No. Everything runs locally; no requests are made and nothing is stored.