Regex Studio
Build, test, and debug regular expressions in real time. Matches highlight instantly as you type, with detailed match info and a built-in quick reference.
// drag a file here to load it
⚡ Live matching
Matches highlight in real time as you type your pattern — no button press needed. Instant feedback on every keystroke.
🎨 Match highlighting
Every match is highlighted directly in your test string so you can see exactly what your pattern is capturing at a glance.
📋 Match details
See every match listed with its value, index position, and length. Named capture groups are shown separately.
🚩 Flag toggles
Toggle global, case-insensitive, multiline, dotall, unicode, and sticky flags with one click — no need to remember the letters.
📖 Quick reference
Built-in cheat sheet of common regex tokens. Click any token to insert it directly into your pattern.
🔒 100% private
Your patterns and test strings never leave your browser. Safe to test against real data and sensitive strings.
How to use the Regex Studio
Regex syntax fundamentals
A regular expression is a pattern that matches strings. Literal characters match themselves. Metacharacters have special meaning: . matches any character, * means zero or more, + means one or more, ? means zero or one. ^ anchors to the start of a line and $ anchors to the end. Escape a metacharacter with \ to match it literally.
Character classes and groups
[abc] matches any of a, b, or c. [^abc] matches anything except a, b, or c. [a-z] matches any lowercase letter. \d is digits, \w is word characters (letters, digits, underscore), \s is whitespace. Parentheses create capture groups: (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string.
Flags and their effects
The g (global) flag finds all matches instead of stopping at the first. The i (case-insensitive) flag makes matching ignore case. The m (multiline) flag makes ^ and $ match line boundaries instead of string boundaries. The s (dotAll) flag makes . match newlines too.
Common regex patterns
Email validation: [\w.-]+@[\w.-]+\.[a-zA-Z]{2,}. URL: https?://[\w./%-]+. IP address: \d{1,3}(\.\d{1,3}){3}. ISO date: \d{4}-\d{2}-\d{2}. UUID: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}. Hex color: #[0-9a-fA-F]{3,6}.