Regex Tester
Test a regular expression against your text with live match highlighting, capture groups and flags — using your browser's native RegExp engine.
What is a regex tester?
Regular expressions — or regex — are patterns that describe the shape of text rather than its exact meaning. A regex tester lets you type a pattern, run it against sample text and immediately see what matches, highlighted in place, with any capture groups listed separately.
It is used for validating input, extracting data from strings, searching logs, cleaning text and writing find-and-replace rules. Because a few symbols carry a lot of meaning, a live tester is invaluable: as you change the pattern the highlights update, so you can experiment until the pattern does exactly what you want.
This tool uses your browser's native JavaScript RegExp engine, so the results match exactly what you would get in Node.js and the browser — and nothing you type ever leaves your device.
How to use
- Type a regular expression in the Pattern box.
- Toggle the flags you need — g for all matches, i to ignore case, m for multiline.
- Paste your test string, then click Run regex to see matches highlighted and capture groups listed.
Example
Pattern \b\d{3}-\d{2}-\d{4}\b matches a US Social Security number such as 123-45-6789. With the g flag it finds all three numbers in the sample text, and each \b anchor ensures the number sits at a word boundary.
Common regex examples
\d+— one or more digits, for numbers.\b\w+@\w+\.\w+\b— a simple email address.\d{4}-\d{2}-\d{2}— an ISO date such as 2026-09-07.#[0-9a-fA-F]{6}— a six-digit hex color code.
Common use cases
- Validating emails, phone numbers and forms.
- Extracting data from logs and documents.
- Building searches and find-and-replace rules.
- Writing quick parse-and-clean scripts.
Pro tips
- Build in small steps and verify each piece as you go.
- Test with strings that should NOT match, not just ones that should.
- Use
.*?(lazy) instead of.*to avoid matching too much. - Escape literal special characters like
.([with a backslash.
FAQ
What is a regex tester?
A regex tester lets you type a regular expression, run it against sample text and see which parts match, with live highlighting and capture groups.
What does \d mean in regex?
\d matches any digit (0-9). \w matches a word character (letter, digit or underscore), and \s matches any whitespace.
What are regex flags?
Flags change how a pattern is applied. Common ones are g (global, all matches), i (ignore case), m (multiline), s (dotAll) and u (unicode).
Why does my regex match nothing?
Check you need the g flag to find all matches, the i flag for case-insensitivity, or the m flag so ^ and $ match at each line. Also escape special characters like . ( ) [ ] with a backslash.
What is a capture group?
A capture group is a part of the pattern wrapped in parentheses. It extracts that portion of the match separately, which is useful for parsing.
How do I match an email or phone number?
Build the pattern in small tested steps rather than one long expression. Verify it catches the cases you want and skips the ones it should.
Is my test data private?
Yes — regular expressions run entirely in your browser using the native RegExp engine, so nothing is sent to a server.
What is the difference between .* and .*?
.* is greedy and matches as much as possible, while .*? is lazy and matches as little as possible.
Related URL & text tools
Related searches
regex tester, regex101, regex test, regular expression tester, regex cheat sheet, regex flags, regex match, regex generator, regex checker, regular expression online
