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:
Waldemar Lewoń
|
Source |
with help of Tom "buckley", Thanks Tom ! |
Your Rating |
|
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}))$