Free Regex Tester. Test and debug regular expressions online for free. Live match highlighting, common pattern library, and instant feedback for developers.

Regex Tester

Test regular expressions with real-time matching, capture groups, and flags

Pattern
//g
Test String
Quick Reference

All processing happens in your browser. No data is sent to any server.

Key Features & Benefits

Real-Time Regex Matching

See matches highlighted in real-time as you type your pattern and test string. Multiple matches are shown in alternating colors (yellow, cyan, pink, lime, orange) so you can easily distinguish between different match groups.

Capture Group Visualization

View all captured groups for each match in a structured display. See the full match and each capture group separately — essential for understanding and debugging complex patterns with multiple groups.

5 Regex Flags Support

Toggle Global (g), Case-insensitive (i), Multiline (m), Dotall (s), and Unicode (u) flags with visual buttons. Each flag shows a description tooltip explaining its purpose.

Common Pattern Presets

Quickly load pre-built patterns for Email, URL, Phone, IP Address, Date, Hex Color, and URL Slug. These presets cover the most frequently needed validation patterns and serve as learning examples.

Interactive Quick Reference

A built-in cheat sheet of 15 essential regex tokens with descriptions. Click any token to append it to your pattern — perfect for learning regex or remembering syntax without leaving the tool.

Instant Error Feedback

Invalid regex patterns are caught immediately with clear error messages. The tool uses JavaScript's native RegExp engine, so the behavior matches exactly what you'll see in your code.

Regex Tester – Frequently Asked Questions

What regex flavor does this tester support?
This tester uses JavaScript's built-in RegExp engine, which follows the ECMAScript specification. This is the same regex engine used in web browsers and Node.js. Most common patterns work identically across JavaScript, Python, and Java, but there are some differences in advanced features like lookbehind assertions and Unicode property escapes.
What are regex flags?
Flags modify how the regex engine processes your pattern. Global (g) finds all matches instead of just the first. Case-insensitive (i) ignores uppercase/lowercase differences. Multiline (m) makes ^ and $ match line boundaries. Dotall (s) makes . match newline characters. Unicode (u) enables Unicode mode for character classes.
Can I use this to test regex for other programming languages?
While the tester uses JavaScript's regex engine, most common patterns (email validation, URL matching, character classes, quantifiers) work identically across JavaScript, Python, Java, PHP, and other languages. Advanced features like named groups, lookbehind, and Unicode properties may behave differently.
What are capture groups?
Capture groups are portions of your regex pattern enclosed in parentheses (). They extract specific parts of a match. For example, the pattern (\d{4})-(\d{2})-(\d{2}) applied to '2025-05-10' would create three capture groups: '2025', '05', and '10'. The tester displays all groups for each match.
Why are my matches showing different colors?
When the Global (g) flag is enabled and there are multiple matches, each match is highlighted in a different color (rotating through yellow, cyan, pink, lime, and orange). This makes it easy to visually distinguish between separate matches in the test string, especially when matches are close together.