How the Regex Tester Works
Type a regular expression pattern in the input field and choose your flags (g for global, i for case-insensitive, m for multiline, s for dotAll, u for unicode, y for sticky). As you type, every match in the test string is highlighted with a colored span. The match list below shows each match's index position, full match text, and any captured groups.
Switch to Replace mode to preview the result of a substitution — use $1, $2, etc. to reference captured groups in the replacement string. The common patterns library provides one-click presets for email, URL, phone, IPv4, IPv6, UUID v4, hex color, credit card, ISO 8601 date, and semver.
References
This tool implements ECMAScript regular expressions as defined in ECMAScript 2026 Language Specification — Section 22.2: RegExp (Regular Expression) Objects (tc39.es/ecma262). The JavaScript RegExp engine runs entirely in your browser — no server call is made.
Secondary reference: MDN Web Docs — Regular Expressions Guide.
What's here, and what's not
Live match highlighting with per-match color coding, a replace preview, six flags, a common pattern library, and a collapsible cheatsheet covering anchors, quantifiers, character classes, groups, and lookarounds.
What isn't here: PCRE-specific features (recursive groups, conditionals, possessive quantifiers), Python re syntax, .NET lookbehind extensions, or multi-engine comparison. This tool runs pure ECMAScript RegExp — what every browser already ships. No PCRE, no Python, no exotic extensions.
When to Use a Regex Tester
Use a regex tester when writing patterns to validate input (emails, phone numbers, postal codes), parse log files, extract data from structured text, replace patterns in code editors, configure web server URL routing, or filter rows in spreadsheets. Testing regex interactively prevents costly bugs from incorrect patterns deployed to production.
Pair regex with related text tools: JSON Formatter, URL Encoder, Case Converter, and Slug Generator.
Common Regex Patterns Reference
Essential patterns every developer should know:
- Email (basic):
[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,} - Canadian postal code:
[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d - US phone:
\(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4} - Date YYYY-MM-DD:
\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]) - URL:
https?://[^\s/$.?#].[^\s]* - IPv4:
(\d{1,3}\.){3}\d{1,3}
Flags: g (global — find all matches), i (case-insensitive), m (multiline — ^/$ match line boundaries), s (dotAll — . matches newlines).
Frequently Asked Questions
Which regex engine does this use?
What does the g (global) flag do?
How do captured groups work in replace mode?
Is this compatible with PCRE (PHP, Python, Ruby)?
Where is the regex spec documented?
What is the difference between greedy and lazy quantifiers?
What do anchors ^ and $ do in regex?
By Bam's Thinkery — Updated