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 4
Title Test Details Swedish social security number (Svenskt personnummer)
Expression
\b(((20)((0[0-9])|(1[0-1])))|(([1][^0-8])?\d{2}))((0[1-9])|1[0-2])((0[1-9])|(2[0-9])|(3[01]))[-+]?\d{4}[,.]?\b
Description
Matches a Swedish social security number in format xxYYMMDD-NNNN, xxYYMMDD+NNNN, YYMMDD-NNNN, YYMMDD-NNNN and YYMMDDNNN. Does not allow birth years before 1900 and after 2011. To raise the birth year to higher level of birth just change the 1[0-1] part to i.e. 1[0-4] to allow birth years up to 2014 etc. This will find the SSN within a string. Also allow for a comma(,) or period(.) behind the SSN.
Matches
7712314582 | 810325+0782 | 19771231-4582
Non-Matches
137712314582 | 201211224567 | 10880215-0987
Author Rating: Not yet rated. Emil
Title Test Details Swedish social security number (Svenskt personnummer)
Expression
^(((20)((0[0-9])|(1[0-1])))|(([1][^0-8])?\d{2}))((0[1-9])|1[0-2])((0[1-9])|(2[0-9])|(3[01]))[-]?\d{4}$
Description
Matches a Swedish social security number in format CCYYMMDD-NNNN, CCYYMMDDNNNN, YYMMDD-NNNN and YYMMDDNNNN on a single line. More useful version of my earlier expression. Will only match 1900 - 2011 years.
Matches
7712314582 | 810325-0782 | 19771231-4582 | 197712314582
Non-Matches
137712314582 | 201211224567 | 10880215-0987
Author Rating: Not yet rated. Emil
Title Test Details e-mail match
Expression
^(?=.*\S)[-!#$%&\'*+\/=?^_`{|}~,.a-z0-9]{1,64}[@]{1}[-.a-zåäö0-9]{4,253}$
Description
Matches most theoretical e-mail patterns including Swedish letters and custom top domains. Relies on minimum and maximum allowed length of different parts of the e-mail. NOTE: Needs to have "case insensitive flag".
Matches
Non-Matches
[email protected] | foo [email protected] | foobar | @bar.com
Author Rating: Not yet rated. Emil
Title Test Details Simple password match
Expression
^\S{1}(?:.){4,}\S$
Description
Check if a string contains at least 6 characters. Can not end or start with whitespace but can contain any other. PCRE optimized with none-capturing parentheses.
Matches
4 good p@ssW0rd? | password
Non-Matches
pass | word | 12345
Author Rating: Not yet rated. Emil
   Displaying page 1 of 1 pages; Items 1 to 4

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