Skip to content

Commit

Permalink
Updated regexp to not accept 000x as last digits. Updated xunit to la…
Browse files Browse the repository at this point in the history
…test.
  • Loading branch information
Johannestegner committed Jun 16, 2020
1 parent a6ad6f6 commit d7ac9b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Personnummer.Tests/Personnummer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.core" Version="2.4.1" />
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Personnummer/Personnummer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static bool Valid(string ssn)
}

#region Static internal.
private static readonly Regex regex = new Regex(@"^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([\+\-\s]?)(\d{3})(\d)$");
private static readonly Regex regex = new Regex(@"^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([\+\-\s]?)((?!000)\d{3})(\d)$");

private static int Luhn(string value)
{
Expand Down

0 comments on commit d7ac9b6

Please sign in to comment.