Build, test, and debug regular expressions
Validates Danish CPR (personnummer) numbers in DDMMYY-SSSS format with an optional hyphen. The birthdate part is strictly checked: day 31 only allowed in 31-day months, Feb 29 only in leap years (with smart handling of year 00 via the century/serial digit, since 1900 is not a leap year but 2000 is), and months restricted to 01-12. Negative lookbehind/lookahead prevent matching inside longer digit runs. Commonly used in Danish municipal (e.g., Varde Kommune) or government systems to validate citizen IDs.