Tools /  Regex Tester

Regex Tester

正規表現テスト
検証済TESTED
//
TEST TEXT
MATCHES3
Send the invoice to hana@example.com by Friday.
CC kenji.sato@workshop.jp and the office: info@chekkutooru.dev
(not-an-email@, and neither is @this)
#1 @20hana@example.com$1=hana$2=example$3=comuser=hana
#2 @57sato@workshop.jp$1=sato$2=workshop$3=jpuser=sato
#3 @90info@chekkutooru.dev$1=info$2=chekkutooru$3=devuser=info
READ ALOUD · token by token
\ba word boundary
(?<user>start capture group named “user”
\wany word character (letter, digit, underscore)
+the previous element, one or more times
)end of the group
@the text “@”, literally
(start capture group 1
\wany word character (letter, digit, underscore)
+the previous element, one or more times
)end of the group
\.the character “.”, escaped
(start capture group 2
[a-z]one character from the set a-z
{2,}the previous element, 2 or more times
)end of the group
\ba word boundary

Everything runs in your browser with JavaScript’s own RegExp engine, so what matches here matches in your code.

How it works

仕組み

Regular expressions are the workshop's sharpest and least forgiving tool. This tester runs your pattern against your text as you type, using the browser's own JavaScript engine, so what matches here matches in your code, byte for byte. Matches highlight in the text, capture groups (numbered and named) are unpacked per match, and the pattern itself is read back to you token by token in plain English.

Why does my pattern only find one match?

Without the g (global) flag, JavaScript stops after the first match. Toggle g in the flag row to find them all, and add i if the case shouldn't matter.

What's the difference between (…) and (?:…)?

Both group, but (…) also captures what it matched; you'll see it as $1, $2… in the match list. (?:…) groups without capturing, which keeps your numbering clean and is marginally faster.

Is this exactly the regex my code will run?

If your code is JavaScript, yes: it's the same engine. Other languages share most syntax but differ at the edges: lookbehind support, named-group style, and character-class details vary across engines like PCRE, RE2, and Python's re.

More on the bench 他の道具
CSS clamp() Calculator
Cron Expression Builder
Meta Tag Previewer
Shadow & Gradient Generator
Viewport Simulator
Tab Order Visualizer
JSON Formatter
Diff Checker