Regex Tester
Test regular expressions against text in real time. Matches are highlighted as you type. Uses the JavaScript ECMAScript regex engine — free, instant, no install.
/
What is a Regex Tester?
A regex tester (regular expression tester) lets you write and test regular expressions against sample text in real time, highlighting matches as you type. This tool uses JavaScript’s built-in RegExp engine, which follows the ECMAScript standard and is identical to what runs in your browser and Node.js.
Regex Flags Explained
- g (global) — find all matches, not just the first one
- i (ignore case) — match uppercase and lowercase interchangeably
- m (multiline) —
^and$match start/end of each line - s (dotAll) —
.matches newline characters as well
Common Regex Patterns
- Email:
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} - URL:
https?://[^\s]+ - Phone (US):
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4} - IPv4:
\b(?:\d{1,3}\.){3}\d{1,3}\b - Hex color:
#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b
Frequently Asked Questions
Which regex engine does this tool use?
This tool uses the JavaScript ECMAScript regex engine — the same engine used in Chrome, Firefox, Safari, and Node.js. It supports most common regex syntax but does not support lookbehind in older browsers or PCRE-specific syntax like \K.
How do I match newlines?
Enable the s (dotAll) flag to make . match newline characters, or use [\s\S] as a workaround without the flag.
