如何写正则表达式 [英] how to write regular expression
本文介绍了如何写正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要asp.net的帮助.
我的朋友的名字是sharon.我的要求是,只要他输入他的名字,就会显示一条消息错误输入".我想使用常规的表达式验证器来执行此操作...
所以我应该在验证表达式中写什么表达式.
i need a help in asp.net.
My friends name is sharon.My requirement is as soon as he types his name one message should be displayed that "wrong entry ". i want to use the regular expresion validator to do this ...
so what expression should i write in validation expression.
推荐答案
不要对这样简单的东西使用正则表达式.在这种情况下,不区分大小写的String.Compare
要容易得多.
问候,
曼弗雷德(Manfred)
Dont''t use a regular expression for something as simple as that. It''s far easier in this case to do a case insensitiveString.Compare
.
Regards,
Manfred
我建议您从下面的文章开始.
30分钟正则表达式教程
轻松学习正则表达式(RegEx)
I suggest, you begin with below Articles.
The 30 Minute Regex Tutorial
Learn Regular Expressions (RegEx) with Ease
开始在这里进行一些研究
http://www.regular-expressions.info/reference.html [ http://www.ultrapico.com/Expresso.htm [
Start by doing some research here
http://www.regular-expressions.info/reference.html[^]
This tool will help you test what you come up with after reading the above
http://www.ultrapico.com/Expresso.htm[^]
这篇关于如何写正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文