TutorialMay 23, 2026
Common Regex Examples for Developers
Regular expressions are patterns for matching text. Here are proven patterns developers use daily — test them live with WaiHub's Regex Tester.
Useful Patterns
Email (basic): [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}. URL (basic): https?://[\w.-]+\.\w{2,}[^\s]*. Phone (US): \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}.
UUID: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}. Integer: -?\d+. IPv4: \d{1,3}(\.\d{1,3}){3}.
Testing Tips
Always anchor patterns (^ and $) when validating whole strings. Test edge cases: empty strings, Unicode, and boundary values. Use the pattern library in WaiHub's Regex Tester to load and customize templates.