Regex Shuttle — Free Online Regex Tester, Explainer & Cheat Sheet
Test, explain, and learn regular expressions in your browser. Real-time matching, pattern library, substitution, and cheat sheet. 100% private. Free forever.
Explore PatternsSubstitution
No matches found
Pattern Library
Common regex patterns ready to use
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/gMatches standard email addresses like user@example.com
Example:
Contact us at hello@example.com or support@test.org
URL
Common/https?:\/\/[^\s]+/gMatches HTTP and HTTPS URLs
Example:
Visit https://example.com or http://test.org/path?q=1
Phone
Common/(\+\d{1,3}[- ]?)?\(?\d{3}\)?[- ]?\d{3}[- ]?\d{4}/gMatches US phone numbers with optional country code
Example:
Call +1 (555) 123-4567 or 555-987-6543
IPv4
Developer/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/gMatches IPv4 addresses like 192.168.1.1
Example:
Server at 192.168.1.1 and gateway 10.0.0.1
Date
Common/\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])/gMatches dates in YYYY-MM-DD format
Example:
Born on 1990-05-15, updated 2024-12-31
Time
Common/([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?/gMatches 24-hour time format (HH:MM or HH:MM:SS)
Example:
Meeting at 14:30, alarm 07:00:00
Hex Color
Developer/#[0-9a-fA-F]{3,8}/giMatches hex color codes (#RGB, #RRGGBB, #RRGGBBAA)
Example:
Colors: #fff, #ff5733, #000000ff
HTML Tag
Developer/<([a-z]+)([^>]*)>(.*?)<\/\1>/gsiMatches HTML tags with their content
Example:
<div class='test'>Hello</div> and <p>World</p>
Credit Card
Common/\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}/gMatches credit card number patterns
Example:
Card: 4111-1111-1111-1111 or 4111 1111 1111 1111
UUID
Developer/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/giMatches UUID/GUID format
Example:
ID: 550e8400-e29b-41d4-a716-446655440000
Slug
Developer/[a-z0-9]+(?:-[a-z0-9]+)*/gMatches URL-friendly slug strings
Example:
my-blog-post and hello-world-123
Username
Validation/^[a-zA-Z0-9_-]{3,20}$/mMatches usernames (3-20 chars, alphanumeric, underscore, hyphen)
Example:
user_name and John-Doe and admin123
Strong Password
Validation/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/mRequires uppercase, lowercase, digit, special char, min 8 chars
Example:
P@ssw0rd and Str0ng!Pass
US Zip Code
Common/^\d{5}(-\d{4})?$/mMatches US ZIP codes (5-digit or ZIP+4)
Example:
90210 and 10001-1234
Why a Regex Tester Matters
Regular expressions are deceptively easy to write and notoriously hard to get right. A pattern that looks correct can silently miss edge cases, over-match, or fail on real-world input — and you often don't find out until it reaches production. A dedicated regex tester collapses that feedback loop from minutes to milliseconds: you type a pattern, paste representative text, and immediately see what matches, what doesn't, and exactly where each match starts and ends. That instant visibility is what turns regex from guesswork into engineering.
The payoff goes beyond convenience. Testing patterns interactively prevents costly mistakes — a too-greedy quantifier that corrupts a data migration, a validation regex that rejects valid emails, or a catastrophic-backtracking pattern that stalls your server. It also flattens the learning curve: by seeing how each token, group, and quantifier behaves against live text, you build real intuition instead of copying patterns you don't understand. Whether you're debugging a colleague's cryptic expression or crafting your first character class, working against concrete examples is the fastest, safest way to learn.
How Regex Shuttle Is Different
Many online regex tools send your patterns and test data to a server for processing. Regex Shuttle does the opposite: every match, substitution, and explanation runs entirely in your browser using the native JavaScript RegExp engine. Nothing is uploaded, logged, or stored — your patterns and the text you test against never leave your device. That makes it safe to paste sensitive log lines, customer records, or proprietary data without worrying about where it goes, and it means the tool keeps working even offline after the first load.
Local processing also gives you a guarantee that server-based testers can't: engine consistency. Because Regex Shuttle uses the exact same RegExp implementation that ships in your browser and Node.js, the behavior you observe here is the behavior you'll get in production JavaScript. There's no translation layer or alternate regex flavor introducing subtle differences. On top of that, you get a complete free toolkit — a real-time tester, token-by-token explainer, substitution preview, a curated pattern library, and a searchable cheat sheet — with no account, no limits, and no ads.
How It Works
Enter Pattern
Type your regular expression in the pattern field with optional flags like g, i, m
Add Test Text
Paste or type the text you want to test against your regex pattern
See Results
View all matches highlighted with detailed information including groups and indices