Regular expression for Dutch zip / postal code

前端 未结 3 1099
南笙
南笙 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 07:00

    Here is my solution. The i in the end makes it case-insensitive:

    var rege = /^\d{4} ?[a-z]{2}$/i;
    

提交回复
热议问题