Two regexps for swedish circumstances

All persons and organisations in Sweden has an identification number, the syntax is nnnnnn-nnnn, here’s a regexp for validating that:
/^\d{6}[./-]\d{4}$/

And here’s another one for validating Swedish zipcodes (nnn nn):
/^\d{3} \d{2}$/

Leave a comment

Your comment