预先构建的正则表达式模式或者正则表达式库?
时间:2020-03-05 18:39:32 来源:igfitidea点击:
使用的任何人都有喜欢使用的良好的正则表达式库吗?我们在网上找到的大多数正则表达式都包含错误或者过于侧重于极端情况,以至于竞争成为100%验证规格的竞赛。当然,我们可以自己编写,但是按小时计费时,可以方便地拥有一个图书馆。
解决方案
回答
除了(几乎)是市场上最好的Regex工具外,RegexBuddy还是我所知道的唯一使我们可以在不同的Regex渲染引擎之间切换的工具。
http://www.regexbuddy.com/
在这里查看信息:
http://en.wikipedia.org/wiki/RegexBuddy
RegexBuddy's proprietary regular expression engine allows the software to emulate the rules and limitations of numerous popular regular expression flavors.
回答
Boost,用于C ++
回答
最近,我在Perl中进行所有文本解析。如果我需要其他语言的正则表达式,则可以使用PCRE。
The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API. The PCRE library is free, even for building commercial software. PCRE was originally written for the Exim MTA, but is now used by many high-profile open source projects, including Apache, PHP, KDE, Postfix, Analog, and Nmap. PCRE has also found its way into some well known commercial products, like Apple Safari. Some other interesting projects using PCRE include Chicken, Ferite, Onyx, Hypermail, Leafnode, Askemos, and Wenlin.
PCRE已经成熟,并得到了众多项目的支持。 Apache和Apple都对提高其质量有着既得利益。我怀疑其他任何RE库是否有可能在不久的将来在功能和质量上(或者可能两者)都超过它。
回答
我们可以在regexlib中搜索正则表达式。
回答
当我们输入文字时,e-texteditor会突出显示我们要搜索的内容。这非常有用,因为我们可以将"示例文本"粘贴到文件中,然后在搜索字段中键入正则表达式,然后在我们面前看到它的匹配项。
这些"可视化正则表达式生成器"都不能替代实际的学习正则表达式。