Regex Tester
Test JavaScript regular expressions in real time — with live match highlighting and capture group display.
Test String
ResultNo matches
Character Classes
Anchors
Quantifiers
Groups & Lookaround
Character Sets
Escape Characters
Flags
What is a Regular Expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. In JavaScript, regex is used with RegExp and string methods like match(), replace(), and split(). This tool runs entirely in your browser using the built-in JavaScript RegExp engine — no installation required.
Flag Reference
gGlobal
Finds all matches in the string instead of stopping at the first match.
iIgnore Case
Makes the pattern case-insensitive. /hello/i matches Hello, HELLO, and hello.
mMultiline
^ and $ match the start and end of each line, not just the whole string.
sDot All
The . metacharacter matches any character including newline (\n).
uUnicode
Enables full Unicode support including \u{XXXX} code point escapes and Unicode property escapes.
Common Regex Patterns
| Use Case | Pattern |
|---|---|
| Email validation | ^[\w.-]+@[\w.-]+\.\w{2,}$ |
| Extract numbers | \d+ |
| Extract URLs | https?://[^\s]+ |
| Extract Korean | [가-힣]+ |
| Remove whitespace | \s+ |