The Regex Tester lets you write, test, and debug regular expressions against live text with instant match highlighting. Matches are highlighted in real-time as you type. Captured groups are displayed clearly below the text.
One-click templates instantly load a ready-made pattern and sample text for common extraction tasks — emails, URLs, phone numbers, numbers, IP addresses, hashtags, mentions, dates, hex colors, and prices — so developers and marketers can pull structured data out of raw text without writing a pattern from scratch.
This tool supports full JavaScript (ECMAScript) regex syntax, including lookaheads, lookbehinds, named capture groups, character classes, quantifiers, anchors, and Unicode properties.
Regular expressions are a powerful tool for text processing, data validation, log parsing, search-and-replace, and text extraction. Testing them against real data before using them in your code prevents bugs and saves time.
Everything runs locally in your browser. Your data never leaves your device, and no account or sign-up is required.
Click a template (Emails, URLs, Numbers, etc.) to instantly load a ready-made pattern and sample text — or write your own pattern in the Pattern field.
Select flags: global (g), case-insensitive (i), multiline (m), dotall (s).
Paste your own text in the input area to test it against the pattern.
Matches are highlighted in real-time and captured groups are shown below.
The Regex Tester is built for exploring and debugging a pattern — it highlights every match live, shows captured groups separately, and lets you try templates for common patterns like emails or URLs without changing your original text.
Find & Replace is built for applying a pattern to actually transform text — once you know your pattern works, use Find & Replace to run the substitution across your real data. A typical workflow is to perfect the pattern here first, then paste it into Find & Replace to do the actual replacement.
Each template button (Emails, URLs, Phone Numbers, Numbers, IP Addresses, Hashtags, Mentions, Dates, Hex Colors, Prices) instantly fills in a tested regex pattern plus sample text, so you can see real extraction results immediately and adapt the pattern to your own data.
Full JavaScript (ECMAScript) regex syntax including lookaheads (?=...), lookbehinds (?<=...), named groups (?<name>...), character classes, quantifiers, anchors (^ $), and Unicode.
Escape special characters with a backslash: \. matches a literal dot, \( matches a literal opening parenthesis.
The global flag finds all matches in the text instead of stopping at the first match.
A basic pattern: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
A basic pattern: https?:\/\/[^\s/$.?#].[^\s]* — for production use consider a well-tested library.
Yes — syntax: (?<groupName>pattern). The named groups are displayed in the capture group panel below the text.
Yes — click the URLs template to load a ready-made pattern, then paste your text to see every URL extracted and listed as a match.
Yes — write or load a phone number pattern, then test various sample inputs to confirm your pattern correctly matches valid formats and rejects invalid ones.
Yes — click the Hashtags template, or write a pattern like #\w+ to match every hashtag in your pasted text.