思路话语

。Arlen:思想有多远你就能走多远...

推荐一个写正则表达式的工具和一个搜正则表达式的网页

工具: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.

posted on 2006-11-24 13:38  Arlen  阅读(420)  评论(1编辑  收藏  举报

导航