Regex Tester
Test regex patterns and check matching results.
Regex Pattern
Enter the regex to test
//
Example Patterns
Load commonly used regex patterns
Test String
Enter the string to test the regex against
Match Results
No matches
Regex Cheat Sheet
Basic Characters
- • .- Any character (except newline)
- • \d- Digits (0-9)
- • \w- Word characters (a-z, A-Z, 0-9, _)
- • \s- Whitespace characters
- • [abc]- One of a, b, c
- • [a-z]- Range from a to z
Quantifiers
- • *- 0 or more
- • +- 1 or more
- • ?- 0 or 1
- • {n}- Exactly n
- • {n,m}- Between n and m
- • {n,}- n or more
Anchors
- • ^- Start of string
- • $- End of string
- • \b- Word boundary
- • \B- Not word boundary
Groups
- • (abc)- Capturing group
- • (?:abc)- Non-capturing group
- • a|b- a or b
- • (?=abc)- Positive lookahead