爱猫的狗

拥抱变化

The Regulator 轻松上手

    正则表达式的概念和作用就不多说了。正则表达式不好写(不好想),所以有很多工具来帮助我们写正则表达式,The Regulator 就是其中的佼佼者(被列入MSDN上的知名文章《Ten Must-Have Tools Every Developer Should Download Now》)。  The Regulator官方网站http://sourceforge.net/projects/regulator/。本文对The Regulator 的使用作一个简单介绍(v2.03版)。


    The Regulator窗口主要分为六部分:Web Search、Regex Analyzer、SnippetsControl、表达式输入区、Match结果区、待解析文本区。比较重要的是Regex Analyzer、表达式输入区、Match结果区、待解析文本区。在默认情况下,Web Search区占了很大位置,可能需要调整一下。

    基本用法:在表达式输入区、待解析文本区 输入你心目中的表达式和待解析文本,然后点菜单栏中的Match,结果会显示在Match结果区。

    如果你想弄清楚一个正则表达式的意思,可以利用Regex Analyzer(在View菜单),不过该功能有时候无法解析出结果,此时可以把表达式输入区 或者 待解析文本区 中的内容稍微改一下(比如添加一个空格),或许就可以解析出正确的结果了。比如我输入 \d{2}-\d{5} ,会解析出 Any digit Exactly 2 times - Any digit Exactly 5 times    。可以帮助我们理解一个复杂的正则表达式。 
     其他有用的功能:生成代码(C# or VB.NET)、直接编译成DLL、从网站检索现成的正则表达式 (Web Search)、保存常用的表达式(SnippetsControl)等等 。


      说到正则表达式,还有一个工具很有名气:Expresso http://www.ultrapico.com/。这个工具在codeproject上有详细介绍,出品时间也比The Regulator早。The Regulator的作者也受到了Expresso 的影响,才开发的The Regulator。他在The Regulator的帮助文件中说:“The Original idea for The Regulator came from a simple Regex Tester called "Expresso". It was simple and easy to use (to a certain degree), but it mainly prompted the idea in me that I could build something similar with features that I wished I had.
So thanks, Expresso. Couldn't have done this one without ya! ”

     

     
   

posted on 2005-02-20 13:24 anf 阅读(1986) 评论(4)  编辑 收藏 网摘 所属分类: .NET 技术

评论

#1楼 2006-09-07 16:36 tiger[匿名]

正则真难哦~~~
  回复  引用    

#2楼 2007-06-09 15:06 yyy[未注册用户]

能发一份到我MAIL吗?
地址打不开//下载不了
谢谢啊
  回复  引用    

#3楼 2007-06-09 15:07 yyy[未注册用户]

我的MAIL:yuwy.sh@163.com
  回复  引用    

#4楼 2007-07-14 21:49 The Regulator 2.0.3[未注册用户]

The Regulator 2.0.3

http://www.1024k.cn/Soft/2007/200707/301.html
  回复  引用    




发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 106350




相关文章:

相关链接: