I have used RE2 .Net in an application, and let me tell you that this is best regex filtering tool ever. It has given me more than 10x improvement in the performance in most cases.
It depends on your requirement though. If you have a text file and if the need is to filter the file using a list of regular expressions then I would recommend GREP. If you are trying to filter a large data set using a huge set of regex's where performance is a concern, then you could go with RE2. But, beware of the limitations in the syntax which are listed in https://code.google.com/p/re2/wiki/Syntax.
Yeah, I'm with Daniel on this one . . . before I'd go hunting from some rogue implementation of Reg Exp . . . I'd make sure I was pre-compiling regular expressions where I could, that greedy options, etc were all set correctly and that the reg expression themselves were not "dumb" in some way . . .
I suspect replacing the standard package is not the optimal solution. Of course without knowing more about your requirements it is hard to know for sure . . . but if the impact of the RegExp package is that huge on your performance, I'd look at the RegExp's themselves first.
发布评论
评论(2)
我在一个应用程序中使用过 RE2 .Net,让我告诉你这是有史以来最好的正则表达式过滤工具。在大多数情况下,它使我的性能提高了 10 倍以上。
您可以在此处下载 C++ 源代码和 .net 库,
https://github.com/0xcb/Re2.Net
这取决于您的要求。如果您有一个文本文件并且需要使用正则表达式列表来过滤该文件,那么我会推荐 GREP。
如果您尝试使用大量正则表达式来过滤大型数据集,并且性能是一个问题,那么您可以使用 RE2。但是,请注意 https://code.google 中列出的语法限制。 com/p/re2/wiki/语法。
I have used RE2 .Net in an application, and let me tell you that this is best regex filtering tool ever. It has given me more than 10x improvement in the performance in most cases.
You can download the source code which is in C++ and the .net libraries here,
https://github.com/0xcb/Re2.Net
It depends on your requirement though. If you have a text file and if the need is to filter the file using a list of regular expressions then I would recommend GREP.
If you are trying to filter a large data set using a huge set of regex's where performance is a concern, then you could go with RE2. But, beware of the limitations in the syntax which are listed in https://code.google.com/p/re2/wiki/Syntax.
是的,我和丹尼尔一起讨论这一点。 。 。在我去寻找 Reg Exp 的一些流氓实现之前。 。 。我会确保我尽可能地预编译正则表达式,贪婪选项等都已正确设置,并且 reg 表达式本身在某种程度上不是“愚蠢的”。 。 。
我怀疑更换标准包并不是最佳解决方案。当然,如果不了解更多有关您的要求的信息,就很难确定。 。 。但如果 RegExp 包对您的性能的影响那么大,我会首先看看 RegExp 本身。
坦率
Yeah, I'm with Daniel on this one . . . before I'd go hunting from some rogue implementation of Reg Exp . . . I'd make sure I was pre-compiling regular expressions where I could, that greedy options, etc were all set correctly and that the reg expression themselves were not "dumb" in some way . . .
I suspect replacing the standard package is not the optimal solution. Of course without knowing more about your requirements it is hard to know for sure . . . but if the impact of the RegExp package is that huge on your performance, I'd look at the RegExp's themselves first.
Frank