Regex Tester Online
Test regular expressions with live match highlighting and match count.
Write, test, and debug regular expressions in real time against any test string. Matches are highlighted as you type, capture groups are listed, and the tool supports JavaScript, Python, and PCRE regex flavors.
Features
Use Cases: When This Tool Helps
-
Validate form input
Build and test patterns for emails, phone numbers, postal codes, and IDs before shipping a form.
-
Extract data from text
Pull order numbers, prices, or dates out of logs and documents with capture groups.
-
Write search-and-replace rules
Test patterns before using them in VS Code, Google Sheets, or a database update.
-
Set up redirects and routing
Check regex rules for .htaccess, Nginx, or analytics filters against real URLs.
-
Learn regular expressions
See matches highlighted live as you change a pattern — the fastest way to learn regex.
-
Debug a pattern that won't match
Find out which part of a complicated expression is failing.
How to Test Regex
- Enter your regex pattern in the pattern field.
- Paste your test string below.
- Matches highlight automatically. View capture groups in the results panel.
FAQ
What is a regular expression?▾
A regex is a sequence of characters that forms a search pattern. Used for pattern matching, validation, find-replace operations, and text parsing.
What flags are supported?▾
g (global), i (case insensitive), m (multiline), s (dotall) — all standard JavaScript flags are supported.
Regex Quick Reference
- . → any character
- \d → digit, \w → word char
- * → 0 or more, + → 1 or more
- ^ → start, $ → end
- [abc] → character class
- (x) → capturing group