Regex Tester
Test and validate regular expressions in real-time
Match Results
0 matches
Enter a regex pattern and test text to see matches
Quick Reference
Character Classes
\d digit\w word char\s whitespace. any char[abc] a, b, or c[^abc] not a, b, or cQuantifiers
* 0 or more+ 1 or more? 0 or 1{n} exactly n{n,m} n to mAnchors
^ start$ end\b word boundaryGroups
(abc) capturing(?:abc) non-capturing\1 backreferenceCommon Patterns
Tip: This tool uses JavaScript's native RegExp. All matches are highlighted in real-time. Use the flags to modify matching behavior. Click on common patterns to quickly test them.
Regex tester: safer patterns for logs, validation, and parsing
Regular expressions excel at structured text extraction but are easy to get wrong. A live tester shows matches, capture groups, and catastrophic backtracking before you ship code to production.
Document the dialect you target—JavaScript, PCRE, and POSIX differ in subtle features.
Practical tips
- Anchor patterns (^ $) when validating whole strings.
- Prefer possessive or atomic groups when performance matters.
- Escape user input before injecting into dynamic regex.
- Add examples to code comments for the next maintainer.
Common questions
- Why no match?
- Check case sensitivity flags, Unicode property escapes, and greedy vs lazy quantifiers.
- ReDoS risk?
- Nested quantifiers on user-controlled strings can explode; test adversarial inputs.
- Multiline logs?
- Toggle dotall and multiline flags depending on engine support.
Related tools on Toolfex
Toolfex provides free online utilities for individuals and teams. Use these guides alongside each tool’s on-page controls. For privacy and data handling, see our Privacy Policy.