validatorjs / validator.js

String validation
MIT License
22.82k stars 2.27k forks source link

Customise postcode validation #784

Open jimmyko opened 6 years ago

jimmyko commented 6 years ago

I can see there is a pattern list for the postal code of different countries embed in this library. And I find some other issue raised to update the list. I faced a similar issue in my project that some of the patterns there does not meet the requirement. It would be great if we can override some of the patterns.

chriso commented 6 years ago

If the patterns are wrong then I'd be happy to accept a PR with a fix.

jimmyko commented 6 years ago

@chriso Thanks for the quick feedback :) I want to use the custom post code doesn't mean the pattern currently using is wrong. The requirement of my project is to only accept one space within the UK's postcode, but some case might want to keep it optional.

JoeEarly commented 5 years ago

How can I get IE support added?

ezkemboi commented 4 years ago

@JoeEarly I have added IE support for postal code and the PR is up for review.

Cc. @profnandaa.