Skip to content

Commit

Permalink
Fix whitespace separator issue (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
frozzare authored Jun 5, 2021
1 parent 7f3dd06 commit 9888574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Personnummer.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static function valid(string $ssn, array $options = []): bool
private static function getParts(string $ssn): array
{
// phpcs:ignore
$reg = '/^(?\'century\'\d{2}){0,1}(?\'year\'\d{2})(?\'month\'\d{2})(?\'day\'\d{2})(?\'sep\'[\+\-\s]?)(?\'num\'(?!000)\d{3})(?\'check\'\d)$/';
$reg = '/^(?\'century\'\d{2}){0,1}(?\'year\'\d{2})(?\'month\'\d{2})(?\'day\'\d{2})(?\'sep\'[\+\-]?)(?\'num\'(?!000)\d{3})(?\'check\'\d)$/';
preg_match($reg, $ssn, $match);

if (empty($match)) {
Expand Down

0 comments on commit 9888574

Please sign in to comment.