Regex Basics and Testing
Regular expressions (regex) are powerful patterns used for matching text. This guide covers the basics and how to test your patterns.
Basic Patterns
.- Matches any single character*- Matches 0 or more of the preceding character+- Matches 1 or more of the preceding character?- Matches 0 or 1 of the preceding character^- Matches the start of a string$- Matches the end of a string
Character Classes
[abc]- Matches any character in the set[^abc]- Matches any character NOT in the set\d- Matches any digit (0-9)\w- Matches any word character\s- Matches any whitespace
Common Flags
g- Global: find all matchesi- Case-insensitive matchingm- Multiline mode
Testing Your Regex
Use our Regex Tester to:
- Enter your regex pattern
- Select appropriate flags
- Add test text
- See matches and capture groups highlighted
Try it now:
Open Regex Tester Tool →