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.
Who is this Regex Tester for?
Regular expressions are a power tool, and almost every technical role touches them now and then. Testing them here avoids trial-and-error in production.
- Developers: validate a pattern against sample strings before wiring it into a script or validator.
- Writers and content creators: find and clean text patterns in a long document without editing every line by hand.
- Marketers: extract mentions, tags or order numbers from a message feed or comment thread.
- Analysts: filter logs and datasets by pattern to isolate the rows that matter.
Common regular expression patterns
The pattern table used by the tester, with a sample string each one matches and what the pattern is really looking for.
| Pattern | Matches | What it matches |
|---|---|---|
| \d+ | Order #4021 | One or more digits |
| ^https:// | https://example.com | Starts with https |
| \b[A-Z][a-z]+\b | Hello World | Capitalized word |
| #[0-9a-fA-F]{6} | #00ff88 | Six-digit hex color |
| \w+@\w+\.\w+ | hi@example.com | Simple email |
| ^\d{4}-\d{2}-\d{2}$ | 2026-09-08 | ISO date |
| \b\d{2,4}\b | port 8080 | Two to four digit number |
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, how to test regex, regex tester 2024, regex tester for india, regex pattern examples, regex to match email, regex find and replace, regex python tester, regex test online free, regex for url
Related tools
- JSON Formatter & ValidatorFormat, pretty-print and validate JSON online for free. Beautify or minify JSON with instant error messages. P…
- XML Formatter & Validator - Pretty Print OnlinePretty-print and validate XML online for free. Beautify XML with clean indentation and find the exact error li…
- Cron Expression Generator & MakerBuild a cron expression from schedule fields and validate it online. Preview the next run time and a plain-Eng…
- IP Subnet CalculatorEnter an IPv4 address and CIDR prefix to see its subnet mask, network, broadcast and usable host range. Instan…
- CSV to JSON Converter OnlineConvert CSV to JSON in your browser. Paste CSV with a header row, choose array of objects or arrays, then copy…
