SHARE
TWEET

Untitled

a guest Sep 17th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private const string civicNumberValidationPatternSwedish =
  2.             @"^(?<date>(?<year>(19|20)?\d{2})(?<month>\d{2})(?<day>\d{2}))[-\+]?(?<additional>\d{3})(?<checkdigit>\d{1})$"; //Swedish
  3.  
  4.         private const string civicNumberValidationPatternSwedishForFormatting =
  5.             @"^(?<date>(?<year>\d{4}|\d{2})(?<month>\d{2})(?<day>\d{2}))[-\+]?(?:(?<additional>[A-Z\d]{4,5})){0,1}$"; //Swedish pattern for formatting between countries
  6.  
  7.         // ddmm(yy)yy-ABCD
  8.         // The year may or may not include the century.
  9.         // The four last digits is a sequence number.
  10.         // The first sequence digit, A, encodes the century of birth.
  11.         // The last digit of the sequence number, D, is odd for males and even for females.
  12.         // The last digit is also a check digit for the entire CPR-number.
  13.         private const string civicNumberValidationPatternDanish =
  14.             @"^(?<date>(?<day>\d{2})(?<month>\d{2})(?<year>(19|20)?\d{2}))[-\+]?(?:(?<additional>\d{3})(?<checkdigit>\d{1})){0,1}$"; //Danish
  15.  
  16.         //ddmmyy-XXXXX
  17.         private const string civicNumberValidationPatternNorwegian =
  18.         @"^(?<date>(?<day>\d{2})(?<month>\d{2})(?<year>(19|20)?\d{2}))[-\+]?(?<additional>\d{5}){0,1}$"; //Norwegian
  19.  
  20.         //ddmmyy-XXXX
  21.         private const string civicNumberValidationPatternFinnish =
  22.             @"^(?<date>(?<day>\d{2})(?<month>\d{2})(?<year>(19|20)?\d{2}))[-\+A]?(?:(?<additional>\d{3})(?<checkdigit>[a-zA-Z\d]{1})){0,1}$"; //Finnish
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top