Test & debug regular expressions online
Test, debug, and validate regular expressions online with real-time match highlighting, capture group visualization, and find & replace preview. Our regex tester runs 100% in your browser—no server uploads, complete privacy. Perfect for developers debugging regex patterns, testing string matching, and learning regular expressions with interactive feedback.
See matches update instantly as you type. Visual highlighting shows exactly what your regex captures with color-coded groups.
All testing happens locally in your browser. Your regex patterns and test strings never leave your device.
Copy working regex code for JavaScript, Python, Go, or Java with one click. Ready to paste into your project.
See exactly what your regex matches with color-coded highlighting. Unlike regex101 which shows matches in a separate panel, we highlight matches directly in your test string for instant visual feedback.
Test find & replace operations with live preview. Use capture group references ($1, $2) in replacement text and see results instantly before applying changes to your code.
Save test cases to validate your regex against multiple strings. Mark each test as "should match" or "should not match" and run all tests at once to verify your pattern works correctly across all scenarios.
Quick reference sidebar with all regex tokens, quantifiers, anchors, and special characters. No need to Google regex syntax—everything you need is right there in the tool.
Type your regular expression in the pattern field. The pattern is automatically wrapped in forward slashes (/ /) like in JavaScript. Select flags:
Paste or type the text you want to test your regex against. Matches will be highlighted in real-time as you type. For multiline patterns, press Enter to add line breaks.
In Match mode, see highlighted matches in your test string and a detailed match table showing positions and capture groups. In Replace mode, enter replacement text (use $1, $2 for capture groups) and see the result instantly.
Once your regex works, click an export button to copy code for JavaScript, Python, Go, or Java. The code includes your pattern, flags, and is ready to paste into your project.
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\bMatches most email formats. Add flags: i for case-insensitive.
https?://[^\s]+Matches HTTP and HTTPS URLs. Use with g flag to find all URLs.
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}Matches formats: (123) 456-7890, 123-456-7890, 123.456.7890
\d{4}-\d{2}-\d{2}Matches ISO 8601 date format: 2025-02-14
#[0-9A-Fa-f]{6}Matches 6-digit hex colors: #FF5733, #1a2b3c
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\bMatches IPv4 addresses: 192.168.1.1
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern, mainly for use in pattern matching with strings. Regex is used for text searching, validation (email, phone numbers), find & replace operations, and data extraction. It's supported in most programming languages including JavaScript, Python, Java, Go, PHP, and more.
Flags modify how the regex pattern behaves. g (Global) finds all matches instead of stopping after the first. i (Ignore Case) makes matching case-insensitive. m (Multiline) makes ^ and $ match line boundaries instead of just string start/end. s (Dot All) makes . match newline characters.u (Unicode) enables full unicode support. y (Sticky) matches only from the lastIndex position.
Capture groups are parts of your regex wrapped in parentheses that extract specific portions of matches. For example, in (\d{3})[-.](\d{3})[-.](\d{4})for phone numbers, the three groups capture area code, prefix, and line number separately. In replacements, reference groups with $1, $2, etc. Named groups use(?<name>pattern) and are referenced with $<name>.
Greedy quantifiers (*, +, {n,m}) match as much text as possible. For example, <.+> on "<a>link</a>" matches the entire string. Lazy quantifiers (*?, +?, {n,m}?) match as little as possible. <.+?> matches only "<a>" and "</a>" separately. Use lazy quantifiers when you want to match the shortest possible string.
Special regex characters like . * + ? [ ] {} ( ) ^ $ | \\ have special meanings. To match them literally, escape them with a backslash. For example, to match a literal period, use\. instead of .To match "example.com" exactly, use example\.com. To match parentheses, use \( and \).
By default, the dot (.) metacharacter doesn't match newline characters. To make . match newlines, enable the s (Dot All) flag. Alternatively, use [\s\S] or(.|\n) to explicitly match any character including newlines. For multiline matching where ^ and $ should match line boundaries (not just string start/end), enable the m (Multiline) flag.