正则表达式接受荷兰邮政编码 [英] Regular Expression to accept Netherlands Postal code

查看:74
本文介绍了正则表达式接受荷兰邮政编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要一些正常表达式的帮助,这两个大小都匹配

1011

1011 NL



我试过正则表达式^ [1-9] [0-9] {3} \s?[a-zA-Z] {2 } $ ....和这场比赛1011 NL但不是1011 ...请帮忙。



谢谢

解决方案

....和这场比赛1011 NL但不是1011 ...请帮助。



谢谢


试试这个正则表达式: -



 var reg = / ^ [1-9] [0-9] {3}?(?!sa | SD | SS)[AZ] {2} 

/ I;


Hi All,

I need some help on the Regular expression which matches both
1011
1011 NL

I tried the regular expression ^[1-9][0-9]{3}\s?[a-zA-Z]{2}$....and this match 1011 NL but not 1011 ...Please help.

Thanks

解决方案

....and this match 1011 NL but not 1011 ...Please help.

Thanks


try this regex:-

var reg = /^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}


/i;


这篇关于正则表达式接受荷兰邮政编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆