Regex Tester

Test regular expressions against any text in real-time. View match details, capture groups, and preview replacements.

🔒Privacy first: All processing happens in your browser. Your text and patterns never leave your device.
Flags:
Quick Patterns:

How to Use the Regex Tester

1

Enter a Pattern

Type a regular expression in the pattern field. Select flags like g (global) or i (case-insensitive). Click a quick pattern button for common patterns.

2

Add Test Text

Paste or type your test string in the text area. The tool shows results in real-time as you type, with matches highlighted and counted.

3

Review Results

See the number of matches, highlighted matches in context, and each match's index and captured groups. Optionally enter a replacement string to preview substitutions.

Common Regex Patterns Reference

PatternMatchesDescription
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}user@example.comEmail address validation
https?://[^\s/$.?#].[^\s]*https://example.comURL matching
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}(555) 123-4567US phone number
\d{4}-\d{2}-\d{2}2026-07-14Date (YYYY-MM-DD)
\b(?:\d{1,3}\.){3}\d{1,3}\b192.168.1.1IPv4 address
#[0-9a-fA-F]{6}\b|#[0-9a-fA-F]{3}\b#ff0000Hex color code

Frequently Asked Questions

This tester uses JavaScript's built-in RegExp engine. It supports all standard JavaScript regex features including lookaheads, lookbehinds, named capture groups, and the 's' (dotall) flag.
g (global): find all matches. i (case-insensitive). m (multiline): ^ and $ match line boundaries. s (dotall): . matches newlines. u (unicode): enable Unicode features. y (sticky): match from lastIndex.
Capture groups are parts of a pattern enclosed in parentheses (). They "capture" the matched text for use in replacements or for extraction. Named groups use (?<name>...) syntax.
Yes. Enter a replacement string in the "Replacement" field. Use $1, $2, etc. for captured groups, $& for the full match, or named groups with $<name>.

Related Tools

Ad