Regex Tester
Test regular expressions in real-time with match highlighting, capture groups, and a built-in cheat sheet.
Regex Cheat Sheet
. Any character except newline\d Digit [0-9]\w Word char [a-zA-Z0-9_]\s Whitespace^ Start of string$ End of string* 0 or more+ 1 or more? 0 or 1{n,m} Between n and m(abc) Capture group[abc] Character classa|b Alternation(?=...) Positive lookahead(?!...) Negative lookaheadDevForge is free and ad-supported. Buy me a coffee if it saved you time.
How to Use This Tool
Enter a regular expression pattern and flags, then type or paste your test string. Matches are highlighted in real-time as you type. The matches table shows each match with its position and capture groups. Use the cheat sheet on the side for quick reference.
Common Use Cases
- Testing regex patterns before using them in code
- Debugging data validation rules for forms and APIs
- Extracting patterns from log files and structured text
- Learning regular expressions with real-time feedback
Frequently Asked Questions
What regex flavor does this tool use?
This tool uses JavaScript's built-in RegExp engine, which implements a flavor of regex similar to PCRE but with some differences (e.g., no lookbehind in older browsers, no atomic groups).
What are regex flags?
Flags modify how the regex engine processes the pattern. 'g' enables global matching (find all matches), 'i' makes matching case-insensitive, and 'm' enables multiline mode where ^ and $ match line boundaries.
Why is my regex not matching?
Common issues include: forgetting the 'g' flag for multiple matches, not escaping special characters like dots and parentheses, or using features not supported in JavaScript regex.