定期快递密码 [英] regular express password

查看:110
本文介绍了定期快递密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




第一个字符和最后一个字符不应该接受空格而在中间它可以接受空格'你可以告诉我常规快递,我该如何验证..

Hi
first character and last character should not accept space and in middle it can accept space''s can u tell me the regular express ,how can i validate..

推荐答案





试试这个正则表达式:

Hi,

Try this regular expression:
<br />
^[^ ].+[^ ]


< br />
<br />



使用正则表达式验证密码:

C#:


To validate the password with the regular expression:
C#:

bool passwordIsInCorrectFormat = System.Text.RegularExpressions.Regex.IsMatch(password,"^[^ ].+[^ ]


);



VB.NET:


VB.NET:

Dim passwordIsInCorrectFormat As Boolean = System.Text.RegularExpressions.Regex.IsMatch(password, "^[^ ].+[^ ]


这篇关于定期快递密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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