Regex Tester & Cheat Sheet
Test regular expressions in real-time and access common patterns.
Flags:
/
/g
No matches found
Cheat Sheet
Regex Tester & Cheat Sheet
Free online Regex Tester and Cheat Sheet. Test your regular expressions against text in real-time. Includes a quick reference guide for common regex patterns.
1How to Use Regex Tester
- Enter your regular expression pattern.
- Add flags (g, i, m) if needed.
- Type or paste your test string.
- Matches will be highlighted instantly.
2Common Use Cases
- Validating email addresses and phone numbers.
- Extracting specific data from large text files.
- Replacing patterns in text editors or code.
3Frequently Asked Questions
What is Regex?βΌ
Regular Expressions (Regex) are sequences of characters that define a search pattern. They are used for string searching and manipulation.
What does the 'g' flag do?βΌ
The 'g' (global) flag indicates that the regex should be tested against all possible matches in a string, not just the first one.
Regex Basics
Meta Characters
.: Any single character^: Start of string$: End of string*: 0 or more+: 1 or more?: 0 or 1
Character Classes
\d: Digit [0-9]\w: Word char [a-zA-Z0-9_]\s: Whitespace[abc]: a, b, or c[^abc]: Not a, b, or c