A quick set of Regexes to check for Personal Information Numbers from the nordic countries.
I use these to check the format only, no fancy calculation of checksums etc.
I use these to check the format only, no fancy calculation of checksums etc.
- Norwegian: DDMMYYXXXXX
\b[0-4]\d[014]\d{3}\d{5}
- Swedish: YYMMDDCXXXX (C == '-' || '+')
\b\d{2}[01]\d[0-3]\d[-\+]\d{4}
- Danish: DDMMYY-XXXX
\b[0-3]\d[01]\d{3}-\d{4}
- Finnish: DDMMYYCZZZQ (C == '-'||'+'||'A' ; Q == [01234536789ABCDEFHJKLMNPRSTUVWXY])
\b[0-3]\d[01]\d{3}[-\+A]\d{3}[0-9A-FHJ-NPR-Y]
- Icelandic: DDMMYY-XXXC (C == 0 || 9)
\b[0-3]\d[01]\d{3}-\d{3}[09]
No comments:
Post a Comment