Regex Tester
Test and debug regular expressions in real-time. Enter a pattern and test string to see matches highlighted instantly. View capture groups, match indices, and counts. Supports all JavaScript regex flags (g, i, m, s, u).
Test and debug regular expressions in real-time with our free regex tester. Enter a pattern and test string to see all matches highlighted instantly. View capture groups, match positions, and counts. Supports JavaScript regex flags including global (g), case-insensitive (i), multiline (m), and dotAll (s). 100% client-side processing means your patterns and text never leave your browser.
100% Client-Side Processing
All regex testing happens directly in your browser using JavaScript's native RegExp engine. Your patterns and text are never sent to any server. This tool works completely offline.
How to Use the Regex Tester
- Enter your regex pattern in the input field. Don't include the surrounding slashes - they're added automatically.
- Select flags to modify how the pattern matches. Enable "g" for finding all matches, "i" for case-insensitive matching, etc.
- Enter test text in the textarea below. Matches will be highlighted in real-time as you type.
- View match details in the table, including capture groups, positions, and the ability to copy individual matches.
- Use named groups like
(?<name>pattern)to make your captures more readable.
Regex Quick Reference
.Any character except newline\dDigit (0-9)\wWord character (a-z, A-Z, 0-9, _)\sWhitespace (space, tab, newline)^Start of string/line$End of string/line*Zero or more+One or more?Zero or one (optional){n,m}Between n and m times[abc]Character class (a, b, or c)[^abc]Not a, b, or c(abc)Capture group(?:abc)Non-capturing groupa|bAlternation (a or b)\bWord boundary(?=abc)Positive lookahead(?!abc)Negative lookaheadRegex Flags Explained
| Flag | Name | Description |
|---|---|---|
| g | Global | Find all matches rather than stopping after the first match |
| i | Case Insensitive | Match uppercase and lowercase letters interchangeably |
| m | Multiline | ^ and $ match the start/end of each line, not just the whole string |
| s | DotAll | Dot (.) matches newline characters as well |
| u | Unicode | Enable full Unicode support (surrogate pairs, Unicode property escapes) |
Related Tools
Working with JSON data? Try our JSON Formatter & Viewer. Need to parse URLs? Use our URL Parser to break down complex URLs and query strings.
Frequently Asked Questions
What regex flavor does this tool use?▼
This tool uses JavaScript's built-in RegExp engine, which implements ECMAScript regular expressions. This is the same regex flavor used in browsers, Node.js, and many other JavaScript environments. Some features like lookbehind assertions are supported in modern browsers but may not work in older ones.
How do I match special characters literally?▼
Special regex characters like . * + ? ^ $ { } [ ] \ | ( ) need to be escaped with a backslash to match them literally. For example, to match a period, use\. instead of .. To match a backslash itself, use \\.
What are capture groups and how do I use them?▼
Capture groups let you extract specific parts of a match. Use parentheses (pattern)to create a group. For named groups, use (?<name>pattern). For example, the pattern (?<area>\d3)-(?<number>\d4) would capture the area code and number separately from a phone number like "555-1234".
Why doesn't my pattern find all matches?▼
Make sure you have the "g" (global) flag enabled. Without it, the regex engine stops after finding the first match. Also check if your pattern is too specific or if the "i" (case insensitive) flag should be enabled for matching different cases.
Is my data safe when using this tool?▼
Yes, completely safe. This regex tester runs entirely in your browser using JavaScript. Your patterns and test text are never sent to any server. There's no backend processing, no logging, and no data storage. You can even disconnect from the internet and the tool will continue to work.
Frequently Asked Questions
❓ Is this tool free?
Yes! All our tools are completely free. No registration, no hidden charges, no ads. Just open and use.
🔒 Is my data safe?
Absolutely. All calculations happen in your browser. We don't store, send, or track any of your data. Everything is processed locally on your device.
📱 Can I use this on mobile?
Yes! All our tools are fully responsive and work perfectly on smartphones, tablets, and desktops.
🌐 Do I need internet?
No! Once the page loads, you can use the tool completely offline. All calculations happen in your browser without any server connection.