Regular expression for Dutch zip / postal code

前端 未结 3 1101
南笙
南笙 2021-02-04 06:38

I\'m trying to build a regular expression in javascript to validate a Dutch zipcode.

The zipcode should contain 4 numbers, then optionally a space and then 2 (case insen

3条回答
  •  野的像风
    2021-02-04 06:51

    In case you have trouble using this as pattern for bootstrap validation I suggest you change it to:

        ^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[A-Za-z]{2}$
    

    This way it is still case-insensitive and accepted by the bootstrap validator.

提交回复
热议问题