← All tools

JavaScript Regex Tester

Test JavaScript regular expressions, flags, matches, captures, and replacements locally.

Enter a JavaScript pattern without / delimiters.

Flags

Optional. Uses JavaScript String.replace semantics.

Examples

Pattern, flags, test text, and replacement stay in this browser. Nothing is uploaded or saved.

A regex match is not proof that data is valid, safe, authorized, or suitable for identity verification.

Set a pattern and test text, then run the pattern.

Replacement preview
—

Quick reference

Common tokens

.
Any character except line terminators
\d / \D
Digit / non-digit
\w / \W
Word character / non-word character
\s / \S
Whitespace / non-whitespace
^ / $
Start / end of input or line with m
* + ? {n,m}
Quantifiers
(...) / (?:...)
Capturing / non-capturing group
(?<name>...)
Named capture
\k<name>
Named backreference
(?=...) / (?<=...)
Lookahead / lookbehind
\p{L}
Unicode property; use u or v

JavaScript flags

d
Indices
g
Global
i
Ignore case
m
Multiline
s
Dot all
u
Unicode
v
Unicode sets
y
Sticky

How to use this tool

Enter a JavaScript pattern without delimiters, select only the flags your runtime uses, test with disposable text, and inspect capture ranges before copying a result.

When not to use it

A match is not validation, authorization, or proof that identity, security, or untrusted input is safe.