Regex Tester
Write a pattern, pick your flags, and see matches highlighted in real time. Capture groups are listed in a table and each part of your regex is explained in plain English.
Used 4,900 times
Latest Developer Tools articles
HEX ↔ RGB ↔ HSL Color Converter
Convert colors between HEX, RGB, and HSL, build palettes, and ensure accessible contrast. Includes CSS snippets and WCAG guidance.
Compare Text Online – Diff Checker Tool Guide
Learn how to use an online diff checker to compare two text blocks, spot code changes, and catch config mismatches — with line-by-line highlighting and practical examples.
.env File Editor – Keep Environment Variables Consistent
Standardize .env files across dev, staging, and production. Learn how to sort keys, deduplicate secrets, and avoid missing variables.
What is a Regex Tester?
A regex tester lets you write a regular expression and immediately see which parts of your test string it matches — without running code. This tool highlights every match inline, lists captured groups in a table, and explains each token in your pattern in plain English, making it easy to iterate on complex patterns.
How to Use
- Enter your pattern in the Pattern field (without delimiters).
- Toggle flags:
g(global),i(case-insensitive),m(multiline). - Paste your test string — matches are highlighted in real time.
- Use quick-insert buttons (Email, URL, IP, Phone) to load common patterns instantly.
- Check the capture groups table and the plain-English explanation below.
Common Regex Mistakes
- Forgetting the global flag — Without
g, only the first match is returned. - Unescaped special characters — Characters like
.*+?must be escaped with\when you mean the literal character. - Greedy vs lazy quantifiers —
.*matches as much as possible; append?(.*?) for a lazy (minimal) match. - Anchors missing — Without
^and$, the pattern can match anywhere inside a longer string.
FAQs
Which regex flavor does this use?
JavaScript's built-in RegExp engine (ECMAScript). Syntax is compatible with most modern languages but differs from PCRE in areas like lookbehind and named groups.
What does the multiline flag do?
With m, ^ matches the start of each line and $ matches the end of each line, rather than the start/end of the entire string.
Can I use named capture groups?
Yes. Use (?<name>pattern) syntax. Named groups appear alongside numbered groups in the capture groups table.