Hub

πŸ” Regex Tester

Test regular expressions live with match highlighting and code snippets.

/ /
Results 0 matches

Enter a regex and test string above.

Code Snippets

            
        
πŸ“– Flag Reference
gGlobalFind all matches instead of stopping at the first.
iIgnore CaseMatch uppercase and lowercase interchangeably.
mMultiline^ and $ match the start/end of each line, not just the whole string.
sDotall. matches any character including newlines.
πŸ“š Regex Quick Guide

Character Classes

.Any character except newline
\dDigit [0–9]
\DNon-digit
\wWord character [a–z A–Z 0–9 _]
\WNon-word character
\sWhitespace (space, tab, newline)
\SNon-whitespace
[abc]One of: a, b, or c
[^abc]Anything except a, b, or c
[a-z]Character in range a to z

Quantifiers

*0 or more
+1 or more
?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)

Anchors & Boundaries

^Start of string (or line with m)
$End of string (or line with m)
\bWord boundary
\BNon-word boundary

Groups & Lookaround

(abc)Capturing group
(?:abc)Non-capturing group
(?<name>abc)Named capturing group
a|bAlternation β€” a or b
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind