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

Please support RegExLib Sponsors

Sponsors

Expressions by User

Change page:   |    Displaying page 1 of 2 pages; Items 1 to 20
Title Test Details Latitude, Longitude
Expression
\-?(90|[0-8]?[0-9]\.[0-9]{0,6})\,\-?(180|(1[0-7][0-9]|[0-9]{0,2})\.[0-9]{0,6})
Description
Parses Standard Latitude, Longitude notation for identifying earth co-ordinates (as per google maps etc). Allows values in format dd.dddddd,ddd.dddddd (lat, lng) where lat can be in range -90 to 90 and lng in range -180 - 180
Matches
-89.999999,180|0.01234,-12.32|90,180|
Non-Matches
-90.01,0.121|15.00001,181|90.1,-181
Author Rating: The rating for this expression. PJWhitfield
Title Test Details HMRC Unique Tax Ref/ Corporation Tax Ref
Expression
[0-9]{5}\s?[0-9]{5}
Description
Basic UTR and CRT formats, 10 digits however are often written with an optional space after 1st 5
Matches
1234567890|12345 67890
Non-Matches
123 4567890|A123456789
Author Rating: Not yet rated. PJWhitfield
Title Test Details Accounts Office Reference
Expression
[0-9]{3}P[A-Z][0-9]{7}[0-9X]
Description
HMRC Accounts Office Reference (AORef) in format 3digits, the letter P and another letter followed by 7 digits and either an 8th digit or letter X
Matches
123PA12345678|451PW1234523X
Non-Matches
A01PA12345678|123RA1234567X
Author Rating: Not yet rated. PJWhitfield
Title Test Details EU VAT Numbers
Expression
((ATU|DK|FI|HU|LU|MT|SI)[0-9]{8}|BE(0)?{8}|BG[0-9]{9,10}|(ES([0-9]|[A-Z])[0-9]{7}([A-Z]|[0-9]))|(HR|IT|LV)[0-9]{11}|CY[0-9]{8}[A-Z]|CZ[0-9]{8,10}|(DE|EE|EL|GB|PT)[0-9]{9}|FR[A-Z0-9]{2}[0-9]{8}[A-Z0-9]|IE[0-9]{7}[A-Z0-9]{2}|LT[0-9]{9}([0-9]{3})?|NL[0-9]{9}B([0-9]{2})|PL[0-9]{10}|RO[0-9]{2,10)|SK[0-9]{10}|SE[0-9]{12})
Description
Each EU country has its own format for VAT numbers designated by the country code at the start, this pattern matches the code to the format.
Matches
HR12345678901 | EE123456789
Non-Matches
HQ12345678901 | EE12345A789
Author Rating: Not yet rated. PJWhitfield
Title Test Details UK Boat Port Registrations
Expression
(([A-HJ-PRSTW]|A[BDHR]|BCK|B[ADEFHK-ORSUW]|BRD|C[AEFHKLNOSTY]|D[AEHKORS]|F[DEHRY]|G[HKNRUWY]|H[HL]|I[EH]|INS|KY|L[AHIKLNORTY]|M[EHLNRT]|N[ENT]|OB|P[DEHLNTWZ]|R[NORXY]|S[ACDEHMNORSTUY]|SSS|T[HNOT]|UL|W[ADHIKNOTY]|YH)[1-9][0-9]{0,2})|([1-9][0-9]{0,2}([A-HJ-PRSTW]|A[BDHR]|BCK|B[ADEFHK-ORSUW]|BRD|C[AEFHKLNOSTY]|D[AEHKORS]|F[DEHRY]|G[HKNRUWY]|H[HL]|I[EH]|INS|KY|L[AHIKLNORTY]|M[EHLNRT]|N[ENT]|OB|P[DEHLNTWZ]|R[NORXY]|S[ACDEHMNORSTUY]|SSS|T[HNOT]|UL|W[ADHIKNOTY]|YH))
Description
Maritime vessels are required to be registered in the port nearest to them. Each boat is registered with a 2 Alpha and between 1 and 3 digits reference denoting the port and number. Large boats have the alpha first while small vessels start with the digits
Matches
BH156 | AA12 | CA52 | 172FD
Non-Matches
B156H | AC12 | CB52 | 1172FD
Author Rating: Not yet rated. PJWhitfield
Title Test Details Companies House Registration
Expression
(0[0-9]{7}|(AC|BR|FC|GE|GN|GS|IC|IP|LP|NA|NF|NI|NL|NO|NP|NR|NZ|OC|RC|SA|SC|SF|SI|SL|SO|SP|SR|SZ|ZC|R)[0-9]{6})
Description
Unique reference for each company registered with Companies House in the UK
Matches
1234567BR123456 | 7654321LP654321
Non-Matches
1234567BB123456 | 765432LP6543211
Author Rating: The rating for this expression. PJWhitfield
Title Test Details UK NINO National Insurance Number
Expression
([AEHKLTY][ABEHKLMPRSTWXYZ]|B[ABEHKLMT]|C[ABEHKLR]|GY|[JS][ABCEGHJKLMNPRSTWXYZ]|M[AWX]|N[ABEHLMPRSWXYZ]|O[ABEHKLMPRSX]|P[ABCEGHJKLMNPRSTWXY]|R[ABEHKMPRSTWXYZ]|W[ABEKLMP]|Z[ABEHKLMPRSTWXY])[0-9]{6}[A-D]?
Description
None of the 3 previous examples were fully correct, there are only certain combinations of letters at the start of the NINO rather than simply excluding a handful of allowable chars. The suffix on the end can only be A,B,C or D (M&F were deprecated Temp NINO values)
Matches
AB123456A | GY654321D
Non-Matches
AC123456A | GY654321E
Author Rating: Not yet rated. PJWhitfield
Title Test Details Month
Expression
^([1-9]|1[0-2])$
Description
Simple check for a value between 1 and 12
Matches
1 | 2 | 12
Non-Matches
-1 | 13 | A1
Author Rating: Not yet rated. PJWhitfield
Title Test Details week
Expression
([1-9]|[1-4][0-9]|5[0-2])
Description
allows any numeric value between 1 and 52
Matches
1 | 2 | 12
Non-Matches
-1 | 13 | a
Author Rating: Not yet rated. PJWhitfield
Title Test Details Day of the month
Expression
([1-9]|[1-2][0-9]|3[01])
Description
Allows a number between 1 and 31
Matches
1 | 2 | 12 | 31
Non-Matches
-1 | 2.1 | 32 | A
Author Rating: Not yet rated. PJWhitfield
Title Test Details HMRC Tax District Number
Expression
^(?=.*[1-9].*)[0-9]{3}$
Description
3 digit number representing an HMRC Tax Office. Office 000 is not valid
Matches
001 | 123 | 940
Non-Matches
-01 | 000 | 90.1
Author Rating: Not yet rated. PJWhitfield
Title Test Details National Inusrance Contribution Letter
Expression
^[ABCGHJMPQRTWXYZ]$
Description
Allowable NI Contribution letters from 2014/15 Tax Year
Matches
A | H | Z
Non-Matches
D | I | 3
Author Rating: Not yet rated. PJWhitfield
Title Test Details UK VAT Numbers
Expression
^(GB)?([0-9]{9})$
Description
If you dont need to validate anything other than UK Numbers then this is for you, with optional GB at the start. If you need other countries then the EU Pattern is better suited
Matches
GB123456789 | 123456789
Non-Matches
GB12345678 | AA123456789 | 1234567
Author Rating: Not yet rated. PJWhitfield
Title Test Details Pension Scheme Tax Reference
Expression
^[0-9]{8}R[A-HJ-NP-TV-Z]$
Description
Pension Schemes have their own references, 8 digits followed by R and then another letter.
Matches
12345678RA | 43213245RT
Non-Matches
1234567RA | 432132456RR
Author Rating: Not yet rated. PJWhitfield
Title Test Details HMRC Construction Industry Scheme (CIS) Ref
Expression
[A-Za-z]{2}[0-9]{1,6}|[0-9]{1,8}
Description
CIS Reference for Self Employed Construction Industry Workers.
Matches
AA213432 | 12345678
Non-Matches
12AA3456 | 123456AV
Author Rating: Not yet rated. PJWhitfield
Title Test Details Alcohol Tobacco Warehouse Ack Number
Expression
(W(5|6)[D]?\-\d{9})|(W1\-\d{9}(\-\d{2})?)
Description
HMRC generated number to denote acknoweldgement of a ATWD warehouse request
Matches
W5D-123456789 |W1-22
Non-Matches
W2D-123456789 |A1-22
Author Rating: Not yet rated. PJWhitfield
Title Test Details UK Tax Code
Expression
(0T|NT|BR|D[01]|[1-9][0-9]{0,6}([WM]1)?|K[1-9][0-9]{0,6}
Description
All UK tax code combinations, 5 standard code 0T, BR, NT, D0 or D1 and 2 types of codes involving digits and a letter. (also includes optional W1 or M1 indicator)
Matches
D0 | BR | 1060LW1 | K400
Non-Matches
D2 | BT | 1060W | 400K
Author Rating: Not yet rated. PJWhitfield
Title Test Details UK Vehicle Registrations
Expression
^(A[A-HJ-M]|[BR][A-Y]|C[A-HJ-PR-V]|[EMOV][A-Y]|G[A-HJ-O]|[DFHKLPSWY][A-HJ-PR-Y]|MAN|N[A-EGHJ-PR-Y]|X[A-F]|)(0[02-9]|[1-9][0-9])[A-HJ-P-R-Z]{3}$
Description
Current standard UK Registration plates running from Sept 2001 to Feb 2051, basic form AA99AAA but contains prefix combinations, the only number not used is 01
Matches
NE02ABC | AA58DEF
Non-Matches
NF02ABC | AA01WUX
Author Rating: Not yet rated. PJWhitfield
Title Test Details French Vehicle Registrations (SIV)
Expression
^(?=.*[1-9].*)((?!SS)[AHJ-NPR-UW-Z]{2})\-[0-9]{3}\-[AHJ-NPR-UW-Z]{2}$
Description
Format AA-999-AA First 2 chars cannot be combination SS, while 000 is not allowed as the digits. Chars I,O,Q and V are not allowed.
Matches
AA-123-AA | BW-001-EW | AR-934-WWW
Non-Matches
AA-000-AA | BQ-001-EW | IS-045-AA
Author Rating: The rating for this expression. PJWhitfield
Title Test Details Italian Registration Plates
Expression
^[AHJ-NPR-UW-Z]{2}\s?[0-9]{3}\s?[AHJ-NPR-UW-Z]{2}$
Description
Almost identical to French except no hyphens (optional space) and digits 000 are allowed. s in French no letters I,O,Q or V AA999AA
Matches
AA999AA | AA 123 AB | WA756AC
Non-Matches
AI999AA | AQ 123 AB
Author Rating: Not yet rated. PJWhitfield
Title Test Details UK Airport codes
Expression
EMA|QCY|SQZ|ORM|NQT|WTN|CBG|QFO|BEQ|LKZ|LTN|KNF|MHZ|NWI|CLF|QUY|SEN|STN|BEQ|BQH|LHR|NHT|LCY|MME|NCL|BWF|BLK|CAX|LPL|MAN|BBP|BEX|BZZ|LGW|SOU|FAB|OXF|ESH|QLA|LYX|KRH|ODH|RCS|QUC|BBS|GLO|EXT|FFD|BOH|LYE|NQY|LEQ|ISC|UPV|BRS|YEO|CVT|BHX|DSA|HUY|LBA|HRT|BFS|BHD|LDY|ENK|ABZ|OBN|BEB|BRR|CAL|COL|CSA|NRL|INV|SCS|DND|LSI|EOI|EDI|FIE|FOA|ILY|FSS|NDY|ADX|LMO|OUK|PSV|PPW|PIK|GLA|KOI|PSL|SYY|SKL|SOY|LWK|TRE|WRY|WHS|WIC|HAW|CEG|VLY|SWS|CWL|DGX|ACI|GCI|IOM|JER
Description
just a big list of all the allowable UK airport short codes (including Jersey etc)
Matches
EMA | NCL
Non-Matches
AAA | 123
Author Rating: Not yet rated. PJWhitfield
Title Test Details UK Driving Licence Number
Expression
^[A-Z9]{5}[0-9]([05][1-9]|[16][0-2])(0[1-9]|[12][0-9]|3[01])[0-9][A-Z9][0-9][A-Z0-9]([0-9]{2}?)$
Description
The Driving Licence Number consists of letter and numbers mainly taken from the holders personal information, consisting of First 5 chars of surname 1st digit of year of birth Month of birth day of birth 2nd digit of year of birth initials (2) a digit (usually 9) 2 check characters 2 digit serial number
Matches
SMITH610225PJ9WE01
Non-Matches
SMITH613225PJ9WE01
Author Rating: Not yet rated. PJWhitfield
Title Test Details CAS Registry Number
Expression
^[1-9][0-9]{1,6}\-[0-9]{2}\-[0-9]
Description
Other examples of this show there being upto 6 digits at the start however according to the official website, it should be 7 https://www.cas.org/content/chemical-substances/faqs
Matches
506-64-9 | 1234567-21-1
Non-Matches
506-64-19 | 12345678-21-1
Author Rating: Not yet rated. PJWhitfield
Title Test Details Sheet Paper sizes
Expression
^A([0-9]|10)$
Description
Sizes of paper from A0-A10
Matches
A0 | A6 | A10
Non-Matches
A-1 | B1 | A11
Author Rating: Not yet rated. PJWhitfield
Title Test Details Odd Numbers
Expression
^([1-9]+)?[13579]$
Description
Any number possible but must be Odd
Matches
1 | 101 | 7468274629
Non-Matches
2 | 102 | 74583837430
Author Rating: Not yet rated. PJWhitfield
Title Test Details Even Numbers
Expression
^([1-9]+)?[02468]$
Description
Any number possible as long as its even.
Matches
2 | 64 | 4343253298
Non-Matches
3 | 65 | 5345643531
Author Rating: Not yet rated. PJWhitfield
Title Test Details Prime Numbers < 1000
Expression
^([2357]|1[1379]|2[39]|[58][39]|4[137]|[36][17]|7[139]|97|[134]49|1([09][1379]|13|27|3[179]|5[17]|6[37]|7[39]|81)|2(11|2[379]|[36][39]|41|[57][17]|8[13]|93)|3(07|1[137]|3[17]|47|[578][39]|67|97)|4([013479]9|[02369]1|[346]3|[568]7)|5([0269]3|[247]1|[069]9|[4578]7)|6([03469]1|[14578]3|[0147]7|[15]9)|7([056]1|[347]3|[0136]9|[2589]7)|8([128]1|[2568]3|[2578]7|[0235]9)|9([1479]1|[58]3|[034679]7|[12]9))$
Description
Not fully tested but this behemoth of an expression should do Prime Numbers below 1000
Matches
1 | 3 | 971
Non-Matches
2 | 54 | 998
Author Rating: The rating for this expression. PJWhitfield
Title Test Details UK Short Dialing codes
Expression
^(02[03489]|01(1[3-8]|[2-9]1)$
Description
The main dialing codes for the major areas of the UK eg 0191 Tyneside/Sunderland/Durham 0161 Manchester 020 London
Matches
0191 | 0121 | 020
Non-Matches
0291 | 0154 | 030
Author Rating: Not yet rated. PJWhitfield
Change page:   |    Displaying page 1 of 2 pages; Items 1 to 20

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