使用javascript进行代码验证 [英] Post code validation using javascript

查看:92
本文介绍了使用javascript进行代码验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我目前的项目中,我有一个要求,即



我必须输入邮政编码7个字母.....在第一个字母是字母,第二个是数字,第三个是字母,第四个是空格,第五个是字母,六个是数字,第七个是字母.... br />


如何在java脚本中使用正则表达式实现.....



请建议!! !!!



谢谢,

Codehub。

Hi All,

In my current project i have one requirement i.e.

I have to enter post code 7 letters.....In that first letter is Alphabet,second one is Numeric,third one Alphabet, fourth one is space ,fifth one is alphabet,sixt one is numeric and seventh one is Alphabet....

How can i achieve using regular expression in java script.....

Please suggest!!!!!

Thanks,
Codehub.

推荐答案

[a-zA-Z]\d[a-zA-Z]\s[a-zA-Z]\d[a-zA-Z]



[a-zA-Z]表示匹配任何字母大小写的内容

\ d表示匹配任何数字

\ n表示匹配a白色空间

如果你想对字母表强加大小写,请尝试自己修改,非常直观。


[a-zA-Z] means match any alphabet case in-sensitive
\d means match any digit
\s means match a white space
If you want to impose case sensitivity to the alphabets, try modify it yourself, quite intuitive.


这篇关于使用javascript进行代码验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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