🏠 Accueil
Benchmarks
📊 Tous les Benchmarks 🦖 Dinosaure v1 🦖 Dinosaure v2 ✅ To-Do List Apps 🎨 Pages Libres 🎯 FSACB - Showcase 🌍 Traduction
Modèles
🏆 Top 10 Modèles 🆓 Modèles Gratuits 📋 Tous les Modèles ⚙️ Modes Kilo Code
Ressources
💬 Prompts IA 📖 Glossaire IA 🔗 Liens Utiles
Advanced

Complex Pattern Matching Engine

#regex #pattern-matching #validation #technical

Constructing a highly specific regular expression to validate multi-part data strings with conditional formatting.

Construct a single Regular Expression that validates a custom product code string. The string must start with 3 uppercase letters, followed by a hyphen. The next segment must be a numeric digit between 1 and 5. If the digit is 1, the following segment must be exactly 4 lowercase letters. If the digit is greater than 1, the following segment must be 6 alphanumeric characters. The string must end with an optional checksum digit. Explain the back-references and lookaheads used.