The Regulator 轻松上手


轉載自http://anf.cnblogs.com/

    正则表达式的概念和作用就不多说了。正则表达式不好写(不好想),所以有很多工具来帮助我们写正则表达式,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! ”
原文地址:https://www.cnblogs.com/godwar/p/810888.html