RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Swedish personnummer with accepted foreigners
Expression
^[0-9]{6}-[0-9pPtTfF][0-9]{3}$
Description
Other Swedish personnummer regexps do not take into account that at Swedish universities, foreigners might get special temporary personnummers with a "P", "T", or "F" instead of the first of the four last numbers. This code fixes the problem, but does not check the validity of the date, or the last number.
Matches
123456-1234 | 123456-P234 | 123456-f234
Non-Matches
123456-12 | 1234561234 | 123456
Author Rating: Not yet rated. Petter Terenius
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials