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 13
Title Test Details UK Phone Number
Expression
^((\(?0\d{4}\)?\s?\d{3}\s?\d{3})|(\(?0\d{3}\)?\s?\d{3}\s?\d{4})|(\(?0\d{2}\)?\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$
Description
UK phone number. Allows 3, 4 or 5 digit regional prefix, with 8, 7 or 6 digit phone number respectively, plus optional 3 or 4 digit extension number prefixed with a # symbol. Also allows optional brackets surrounding the regional prefix and optional spaces between appropriate groups of numbers.
Matches
01222 555 555 | (010) 55555555 #2222 | 0122 555 5555#222
Non-Matches
01222 555 5555 | (010) 55555555 #22 | 0122 5555 5555#222
Author Rating: Not yet rated. Amos Hurd
Title Test Details UK Mobile Phone Number
Expression
^(\+44\s?7\d{3}|\(?07\d{3}\)?)\s?\d{3}\s?\d{3}$
Description
UK mobile phone number, with optional +44 national code. Allows optional brackets and spaces at appropriate positions.
Matches
07222 555555 | (07222) 555555 | +44 7222 555 555
Non-Matches
7222 555555 | +44 07222 555555 | (+447222) 555555
Author Rating: Not yet rated. Amos Hurd
Title Test Details Modified UK Phone Number
Expression
^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$
Description
Modified version of UK phone number regular expression. Now allows +44 national code in addition to extension numbers of 3 or 4 digits. Previous expression was: ^((\(?0\d{4}\)?\s?\d{3}\s?\d{3})|(\(?0\d{3}\)?\s?\d{3}\s?\d{4})|(\(?0\d{2}\)?\s?\d{4}\s?\d{4}))(\s?#(\d{4}|\d{3}))?$
Matches
+447222555555 | +44 7222 555 555 | (0722) 5555555 #2222
Non-Matches
(+447222)555555 | +44(7222)555555 | (0722) 5555555 #22
Author Rating: The rating for this expression. Amos Hurd
Title Test Details Current UK Vehicle Registration
Expression
^([A-HK-PRSVWY][A-HJ-PR-Y])\s?([0][2-9]|[1-9][0-9])\s?[A-HJ-PR-Z]{3}$
Description
UK vehicle registration system currently in use (as defined by the DVLA and put into effect from September 2001, and therefore does not allow registrations prior to this date).
Matches
AB51DVL | AB 51 DVL
Non-Matches
AZ01DLQ | AZ 01 DLQ
Author Rating: The rating for this expression. Amos Hurd
Title Test Details Older UK Vehicle Registration
Expression
^([A-Z]{3}\s?(\d{3}|\d{2}|d{1})\s?[A-Z])|([A-Z]\s?(\d{3}|\d{2}|\d{1})\s?[A-Z]{3})$
Description
UK vehicle registration system prior to September 2001. Allows both older suffix and the later prefix formats in simple form, with optional spaces.
Matches
ABC123A | A 123 ABC
Non-Matches
AB123A | A 123 AB
Author Rating: Not yet rated. Amos Hurd
Title Test Details Combined UK Vehicle Registration
Expression
^([A-Z]{3}\s?(\d{3}|\d{2}|d{1})\s?[A-Z])|([A-Z]\s?(\d{3}|\d{2}|\d{1})\s?[A-Z]{3})|(([A-HK-PRSVWY][A-HJ-PR-Y])\s?([0][2-9]|[1-9][0-9])\s?[A-HJ-PR-Z]{3})$
Description
UK vehicle registration system. This is the obvious combination of two previous expressions posted here, to merge the older system with the current system.
Matches
ABC 123 A | A 123 ABC | AB 12 ABC
Non-Matches
AB 123 C | A 123 AB | AB 12 AB
Author Rating: Not yet rated. Amos Hurd
Title Test Details UK Domain Names
Expression
^(([a-z][0-9])|([0-9][a-z])|([a-z0-9][a-z0-9\-]{1,2}[a-z0-9])|([a-z0-9][a-z0-9\-](([a-z0-9\-][a-z0-9])|([a-z0-9][a-z0-9\-]))[a-z0-9\-]*[a-z0-9]))\.(co|me|org|ltd|plc|net|sch|ac|mod|nhs|police|gov)\.uk$
Description
UK domain names. Includes the following restrictions from Nominet as at time of posting: 1.Only a-z, 0-9 and hyphen may be used. 2.First or last character may not be a hyphen. 3.Third and fourth characters may not both be hyphens. 4.Third level domain may not be a single character. 5.Third level domain may not be two letters or two numbers. 6.Third level domain may be one letter and one number. This does not yet include the following restrictions: 1.Whole domain may not be longer than 64 characters in length. 2.Third level domain may not duplicate any top/second level domain.
Matches
zeropanic.co.uk | z2.co.uk | 1-1.org.uk
Non-Matches
zeropanic.com | z.co.uk | zz.co.uk
Author Rating: Not yet rated. Amos Hurd
Title Test Details UK Domain Names with Protocol
Expression
^(ht|f)tp((?<=http)s)?://((?<=http://)www|(?<=https://)www|(?<=ftp://)ftp)\.(([a-z][0-9])|([0-9][a-z])|([a-z0-9][a-z0-9\-]{1,2}[a-z0-9])|([a-z0-9][a-z0-9\-](([a-z0-9\-][a-z0-9])|([a-z0-9][a-z0-9\-]))[a-z0-9\-]*[a-z0-9]))\.(co|me|org|ltd|plc|net|sch|ac|mod|nhs|police|gov)\.uk$
Description
UK domains with protocol for http/https/ftp. Based on my previous expression, this allows the subdomain &quot;www&quot; for the http/https protocols, or &quot;ftp&quot; for the ftp protocol only.
Matches
http://www.zeropanic.co.uk | ftp://ftp.sunsite.ac.uk | https://www.z2.co.uk
Non-Matches
gopher://www.z2.co.uk | http://ftp.z2.co.uk | ftp://www.z2.co.uk
Author Rating: Not yet rated. Amos Hurd
Title Test Details UK Domain Names with Protocol and Port
Expression
^(ht|f)tp((?<=http)s)?://((?<=http://)www|(?<=https://)www|(?<=ftp://)ftp)\.(([a-z][0-9])|([0-9][a-z])|([a-z0-9][a-z0-9\-]{1,2}[a-z0-9])|([a-z0-9][a-z0-9\-](([a-z0-9\-][a-z0-9])|([a-z0-9][a-z0-9\-]))[a-z0-9\-]*[a-z0-9]))\.(co|me|org|ltd|plc|net|sch|ac|mod|nhs|police|gov)\.uk(:\d+)?\/?$
Description
UK http/https/ftp URI. Based on my previous expression, this one takes an optional port number and optional trailing slash.
Matches
http://www.zeropanic.co.uk/ | http://www.zeropanic.co.uk:81/ | http://www.zeropanic.co.uk:81
Non-Matches
http://www.zeropanic.com:81/
Author Rating: Not yet rated. Amos Hurd
Title Test Details Basic UK Child Benefit Reference
Expression
^[A-Z]{3}\d{8}$
Description
Basic UK child benefit reference number.
Matches
AAA12345678
Non-Matches
AA12345
Author Rating: Not yet rated. Amos Hurd
Title Test Details AMD Athlon/Duron Codes (not Athlon 64)
Expression
^((A(((H[MX])|(M(P|SN))|(X((D[ACH])|(M[DS]))?)))?)|(K7(A)?)|(D(H[DLM])?))(\d{3,4})[ABD-G][CHJK-NPQT-Y][Q-TV][1-4][B-E]$
Description
Matches valid reference codes for AMD Athlon and Duron processors (not Athlon 64).
Matches
AXDA3200DKV4E | A1000AMT3B | D800AUT1B
Non-Matches
N/A
Author Rating: Not yet rated. Amos Hurd
Title Test Details UK National Insurance Number
Expression
^((A[ABEHKLMPRSTWXYZ])|(B[ABEHKLMT])|(C[ABEHKLR])|(E[ABEHKLMPRSTWXYZ])|(GY)|(H[ABEHKLMPRSTWXYZ])|(J[ABCEGHJKLMNPRSTWXYZ])|(K[ABEHKLMPRSTWXYZ])|(L[ABEHKLMPRSTWXYZ])|(M[AWX])|(N[ABEHLMPRSWXYZ])|(O[ABEHKLMPRSX])|(P[ABCEGHJLMNPRSTWXY])|(R[ABEHKMPRSTWXYZ])|(S[ABCGHJKLMNPRSTWXYZ])|(T[ABEHKLMPRSTWXYZ])|(W[ABEKLMP])|(Y[ABEHKLMPRSTWXYZ])|(Z[ABEHKLMPRSTWXY]))\d{6}([A-D]|\s)$
Description
UK National Insurance (NI) Number, updated 14 Dec 2005 and current for 2006.
Matches
NS123456A | AA555555A | ZY654321
Non-Matches
QB123456A | DD123456D | MB654321X
Author Rating: Not yet rated. Amos Hurd
Title Test Details Simple Microsoft Product Key
Expression
^[A-Z1-9]{5}-[A-Z1-9]{5}-[A-Z1-9]{5}-[A-Z1-9]{5}-[A-Z1-9]{5}$
Description
Simple Microsoft product key check.
Matches
12345-12345-12345-12345-12345 | ABCDE-ABCDE-ABCDE-ABCDE-ABCDE | AB5DE-AB5DE-AB5DE-AB5DE-AB5DE
Non-Matches
12345-123-123456-12345 | ABC-ABCDEF-ABCDE-ABCDE | 12AB5-ABC-12AB567-12AB5
Author Rating: Not yet rated. Amos Hurd
   Displaying page 1 of 1 pages; Items 1 to 13

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