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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Polish NIP validation
Expression
^((\d{3}[- ]\d{3}[- ]\d{2}[- ]\d{2})|(\d{3}[- ]\d{2}[- ]\d{2}[- ]\d{3}))$
Description
allow to insert input for polish tax identyfication number (NIP). Mask accepted: XXX-XX-XX-XXX ; XXX-XXX-XX-XX ; XXX XX XX XXX ; XXX XXX XX XX
Matches
222-22-22-222 | 222-222-22-22 | 222 22 22 222 | 222 222 22 22
Non-Matches
2222222222 | XXXXXXXXXX
Author Rating: The rating for this expression. Waldemar Lewoń
Source with help of Tom "buckley", Thanks Tom !
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Zero only allowed on second digit
Name: mikolajl
Date: 5/12/2016 8:03:39 AM
Comment:
"0" is only allowed on the second digit, so the regexp should rather be: ^(([1-9]\d[1-9][- ][1-9]{3}[- ][1-9]{2}[- ][1-9]{2})|([1-9]\d[1-9][- ][1-9]{2}[- ][1-9]{2}[- ][1-9]{3}))$


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