现在的位置: 首页 > 综合 > 正文

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

2012年02月10日 ⁄ 综合 ⁄ 共 697字 ⁄ 字号 评论关闭
工具: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.

抱歉!评论已关闭.