工具:The Regulator (ver2.0.3.0)
具体使用请看自带的帮助,很简单,也很好用。(^^不用自己再写小程序了)

再推荐一个网页,用来搜索正则表达式,实在是再好不过的一个地方了。
http://regexlib.com/
sample:
下面是搜到的一个验证IP地址的正则表达式:
Title: Pattern Title [Details] [Test]
Expression:
^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$
 
Description: RegExp for validating the format of IP Addresses. This works great with the ASP.NET RegularExpressionValidator server control.
Matches: 127.0.0.1|||255.255.255.0|||192.168.0.1
Non-Matches: 1200.5.4.3|||abc.def.ghi.jkl|||255.foo.bar.1
 
Author: G. Andrew Duthie Rating: The rating for this expression.
http://www.cnblogs.com/Arlen/archive/2006/11/24/570913.html
posted on 2007-05-22 09:55  mbskys  阅读(304)  评论(0编辑  收藏  举报