Regex TesterTools →

Regex Tester

Live JavaScript regex matcher. Capture groups highlighted. Useful for ACL pattern crafting, SIEM rule writing, log parsing.

Pattern

/ /

Test string

Matches

Cheat sheet

\d
digit · \D non-digit
\w
word char (a-z, A-Z, 0-9, _) · \W non-word
\s
whitespace · \S non-whitespace
.
any char (except newline)
^ $
start / end (use m flag for per-line)
* + ?
0+, 1+, 0 or 1 · add ? for lazy
{n,m}
between n and m repetitions
(...)
capture group · (?:...) non-capture · (?P<name>...) named
[abc]
char class · [^abc] negated · [a-z] range
(?=...)
lookahead · (?!...) neg · (?<=...) lookbehind
Flags
g global · i case-insensitive · m multiline · s dotall · u unicode