25 Regex Patterns Every QA Engineer Should Know
The 25 regex patterns QA engineers use daily: email, phone, URL, credit card, dates, UUIDs, log parsing, and more. Test them live in a free regex tester.
2026-07-17 · By Avinash Kamble, reviewed by Priyanka G.
Regex is the QA engineer's Swiss Army knife: input validation, log grep, response parsing, data masking. Here are the 25 patterns worth memorising, all testable in the free Regex Tester for QA.
Validation classics
Email (RFC-lite): ^[\w.+-]+@[\w-]+\.[\w.-]+$
US phone: ^\(?\d{3}\)?[- ]?\d{3}-?\d{4}$
E.164: ^\+[1-9]\d{1,14}$
URL (http/https): ^https?:\/\/[^\s/$.?#].[^\s]*$
IPv4: ^((25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]?\d?\d)$
UUID v4: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
ISO date: ^\d{4}-\d{2}-\d{2}$
ISO datetime: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?$Payment & identity
Visa: ^4\d{12}(\d{3})?$
Mastercard: ^(5[1-5]\d{4}|2(2[2-9]\d{3}|[3-6]\d{4}|7([01]\d{3}|20\d{2})))\d{10}$
CVV: ^\d{3,4}$
IBAN (loose): ^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$
Indian PAN: ^[A-Z]{5}[0-9]{4}[A-Z]$
US SSN: ^\d{3}-\d{2}-\d{4}$Passwords
8+ chars, 1 upper, 1 lower, 1 digit, 1 symbol:
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).{8,}$Log & response parsing
Extract HTTP status: HTTP\/\d\.\d\s(\d{3})
Extract JWT: eyJ[\w-]+\.[\w-]+\.[\w-]+
Mask CC in logs: \b(?:\d[ -]*?){13,16}\b -> ****
Extract Bearer token: Bearer\s+([A-Za-z0-9\-._~+/]+=*)Test them live
All 25 patterns are preloaded in the Regex Tester for QA. Click any pattern, paste sample data, and export the regex as a Java, JavaScript, Python, or C# snippet.
Frequently asked questions
1.Which regex flavour should I learn?
2.Is the email regex 100% RFC compliant?
3.How do I avoid catastrophic backtracking?
4.Are regexes the right tool for HTML parsing?
Practice these questions
Run a live QA mock interview tailored to this topic and get per-skill scoring in minutes.
Was this article helpful?
More from Manual Testing Basics
Test types, defect lifecycle, exploratory testing.
- Career & Interview PrepThe Honest Truth About Manual Testing Salaries in 2026 (Real Data)
- Manual TestingTest Pyramid Explained: A Practical Guide for QA (2026)
- Manual TestingHow to Write Test Cases for a Login Page (with Examples)
Keep building your QA edge
Pillar guides- Regex Tester for QAregex tester for QA engineersLive regex tester with 25+ QA-focused prebuilt patterns and code export for Java, Python, JS, .NET, Go, Playwright, and Rest Assured.
- AI Mock Interviewrehearse out loud with our coachLive AI-powered mock interviews with rubric feedback.
- ATS Resume ReviewSoftwareTestPilot's ATS resume checkerFree AI ATS scoring with rewrite suggestions.
Continue reading
Join the QA Community
Connect with fellow testers, share job leads, and get career advice.
Stop Reinventing the Wheel. Upgrade Your QA Arsenal.
Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.
- Ready-to-use testing strategy templates
- Advanced API & UI automation guides
- ⏱️ Save 10+ hours a week on test planning


