#!/usr/bin/env tsx /** * Test which pattern is matching "00" time */ // Test text from German church const testText = "10:00 uhr lateinisches amt"; const timePatterns = [ { name: '12-hour AM/PM', pattern: /(\d{1,2}):(\d{2})\s*(AM|PM|am|pm|a\.m\.|p\.m\.)/g }, { name: '12-hour no minutes', pattern: /(? 0) { console.log(`✓ ${name}:`); for (const match of matches) { console.log(` Matched: "${match[0]}" at index ${match.index}`); } } else { console.log(`✗ ${name}: no match`); } } // Now test with just "00 uhr" console.log(`\n${'='.repeat(60)}\n`); const testText2 = "00 uhr lateinisches"; console.log(`Test text: "${testText2}"\n`); for (const { name, pattern } of timePatterns) { const matches = [...testText2.matchAll(pattern)]; if (matches.length > 0) { console.log(`✓ ${name}:`); for (const match of matches) { console.log(` Matched: "${match[0]}" at index ${match.index}`); } } else { console.log(`✗ ${name}: no match`); } }