toolcacheAI Coding Prompts › Regex Pattern Library

Regex Pattern Library

Create regex patterns for the following common validation and extraction tasks in [LANGUAGE].

For each pattern, provide:
- The regex with explanation of each part
- Code example showing usage
- Test cases (valid and invalid inputs)
- Edge cases to be aware of

Patterns needed:
1. Email validation (RFC-compliant)
2. Phone number (international format)
3. URL with optional protocol
4. Strong password (min 8 chars, upper, lower, number, special)
5. Credit card number (Visa, Mastercard, Amex)
6. Date (multiple formats: DD/MM/YYYY, YYYY-MM-DD, etc.)
7. IP address (v4 and v6)
8. Slug/URL-friendly string
9. HTML tag extraction
10. Markdown link extraction
11. CSV line parser (handling quoted commas)
12. Color hex code (#FFF and #FFFFFF)
🔒

Unlock this prompt

You have 5 free unlocks remaining

or
Get unlimited access from £2.99 →

How to use this prompt

Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.

Leave a Review

Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.

Get Unlimited Access →Browse All 2,400 Prompts