Regex Tester
Test JavaScript regular expressions live in your browser. Enter a pattern and test string to instantly see match highlighting, match count, and capture group values.
Regular Expression Parameters
Regex Quick Cheat-Sheet Reference▼
- . - Any character except newline
- \d - Any digit (0-9)
- \w - Word character (a-z, A-Z, 0-9, _)
- \s - Whitespace character
- [abc] - Any character in brackets
- [^abc] - Any character NOT in brackets
- * - 0 or more times
- + - 1 or more times
- ? - 0 or 1 time (optional)
- {n} - Exactly n times
- {n,} - n or more times
- {n,m} - Between n and m times
- ^ - Start of string / line
- $ - End of string / line
- \b - Word boundary
- (abc) - Capture group
- (?:abc) - Non-capturing group
- (?<name>abc) - Named capture group
Embed this Tool on Your Website
Copy this code snippet to add the Regex Tester to your blog or website for free. It adjusts dynamically to mobile and desktop screens.
How to Use Regex Tester
Regex Tester Formula / How It Works
Pattern matching runs using JavaScript's native RegExp object. To prevent browser freezes from complex patterns, matching is executed with a 2-second timeout. If a pattern exceeds this limit, a warning is displayed.
For example, the pattern (\d+) with flag g applied to the string 'Order 1234, ref 5678' will find 2 matches: '1234' and '5678', displayed in the capture group table.
Frequently Asked Questions
This tool supports four flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), and s (dotAll — . matches newline characters).
Capture groups are parts of a pattern enclosed in parentheses, e.g. (\d+). They capture matched substrings so you can extract specific parts. Named capture groups use (?<name>\d+) syntax.
Certain regex patterns cause catastrophic backtracking, which can freeze your browser. This tool runs matching in a protected environment and terminates patterns that take more than 2 seconds, keeping your browser responsive.
Yes. This tester uses JavaScript's native RegExp engine, so it supports standard JavaScript regex syntax including lookaheads, lookbehinds, and Unicode property escapes.

