Regex Tester
Test regular expressions online with real-time matching and highlighting. Free regex tool.
How to use: Enter a regex pattern and test string — matches highlight in real time.
//g
How to Test Regular Expressions
Enter your regular expression pattern in the top field. Type or paste your test string in the text area below. All matches are highlighted instantly as you type. Toggle flags (global, case-insensitive, multiline) to modify matching behavior. Capture groups are displayed separately.
Regular Expression Quick Reference
Common patterns: \d (digit), \w (word character), \s (whitespace), . (any character), * (0 or more), + (1 or more), ? (0 or 1), {n,m} (n to m times), [abc] (character class), ^ (start), $ (end), | (or), (?=...) (lookahead). Escape special characters with backslash.
Frequently Asked Questions
- How do I test a regular expression online?
- Enter your regex pattern in the pattern field and paste your test string below. Matches are highlighted in real time as you type. Flags like global (g), case-insensitive (i), and multiline (m) can be toggled.
- What regex syntax does this tool support?
- This tool uses JavaScript's native RegExp engine, supporting standard regex syntax including character classes, quantifiers, groups, lookahead, lookbehind, and named groups.
- How do I match an email address with regex?
- A simple email regex is: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}. For production use, consider using a dedicated email validation library as RFC 5322-compliant email regex is extremely complex.