Pattern
The official version of a Swedish Personal Identity Number (defined in law) follow this pattern:
YYMMDD-BBBC
YYMMDD+BBBC
The delimiter is - (hyphen) by default but changes to + (plus) the year you turn 100. See details below.
It's quite common to leave the hyphen out, like this:
YYMMDDBBBC
When stored or handled in a structured way, the law states you should handle it with the full length of the year, like this:
YYYYMMDDBBBC
https://swedish.identityinfo.net/personalidentitynumber