Regex by

JPKCom Developer Tools

Pattern

Test String

Matches

0 matches
Enter a pattern to see matches

Cheat Sheet

.Any character (except newline)
\dDigit [0-9]
\DNon-digit
\wWord character [a-zA-Z0-9_]
\WNon-word character
\sWhitespace
\SNon-whitespace
\nNewline
\tTab

*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m times
*?0 or more (lazy)
+?1 or more (lazy)

(...)Capturing group
(?:...)Non-capturing group
(?<name>...)Named capture group
\1Backreference to group 1
\k<name>Backreference to named group
(...|...)Alternation (OR)

^Start of string/line
$End of string/line
\bWord boundary
\BNon-word boundary

(?=...)Positive lookahead
(?!...)Negative lookahead
(?<=...)Positive lookbehind
(?<!...)Negative lookbehind

[abc]Match a, b, or c
[^abc]Match anything except a, b, c
[a-z]Range: a to z
[A-Za-z]Any letter
[0-9]Any digit

gGlobal - find all matches
iCase insensitive
mMultiline - ^ $ match lines
sDotall - . matches newlines
uUnicode support
ySticky - match at position