【发布时间】:2011-05-02 06:23:55
【问题描述】:
我有一个很长的正则表达式。我的正则表达式是大约 5000 个或更多短语的组合。
另外,我正在执行正则表达式的文本也很大。文本大小约为 5kb。
由于正则表达式以及输入文本很大,执行该正则表达式至少需要 2 分钟,这在我的项目中是不可接受的。
所以,我想知道如何优化它。我能想到的一种方法是拆分正则表达式并使用多个线程来最小化执行时间。这是正确的选择还是有其他方法?
我的正则表达式的一部分看起来像这样:
(ACS|ADDR.com Technologies|ADP 私人有限公司|ADP|ADP 印度私人有限公司|AIT Software Services PTE 有限公司|AMK 技术私人有限公司|ANMSoft Technologies 私人有限公司|ANZ 信息技术私人有限公司|ASD Global India 私人有限公司| ASD 印度私人有限公司|ASM Technologies 私人有限公司|AXA Group Solutions India 私人有限公司|AXA 技术印度有限公司|Aarkay Infonet 私人有限公司|AbsolutData Research and Analytics 私人有限公司|埃森哲印度私人有限公司|埃森哲服务印度|埃森哲服务有限公司|埃森哲服务私人有限公司|埃森哲|埃森哲软件私人有限公司|Accurum India 私人有限公司|AceTechnologies Inc|Aclat Inc|AcmeCeeYess Softech 私人有限公司|Adaequare India 私人有限公司|Adaequare Info 私人有限公司|Adea International 私人有限公司|Adea Technologies|Adeptra|Aditi Technologies|Adobe系统|Adroit Business Solutions|Adroit and Claretdene Infotech private limited|Affron Infotech|Agile Software Enter Prize 私人有限公司|Agilent Technologies International 私人有限公司|Akebono Soft Technologies 私人有限公司|AkebonoSoft Technologies 私人有限公司|Akmin Technologies|Algorhythm Technologies 私人有限公司|Allsec Technologies 私人有限公司|Alphonso Informex 私人有限公司|Altria 客户服务|Altruist India 私人有限公司|Amdocs| Amdocs Development Center India private limited|Amdocs Development Center India|American CyberSystems|American Express Service India private limited|美国证券交易所|Amrok Securities|Anish 信息技术私人有限公司|Ankhnet Informations 私人有限公司|Apex Technologies 私人有限公司|AppLabs|AppLabs Technologies 私人有限公司|Appshark India|Apptix Software 私人有限公司|Aquila Technologies|Arcot R and D Software 私人有限公司|Arsin Systems 私人有限公司|Ascendum Solutions 私人有限公司|AskMe Software 私人有限公司|Atos Origin 私人有限公司|Atos Origin|Atos Origin India 私人有限公司| Aurigo 软件技术s 私人有限公司|Aurona Technologies 私人有限公司|Autopower Software Solutions|Aztecsoft|BMC Software India 私人有限公司|Balasai Net 私人有限公司|Bayon Solutions 私人有限公司|Beachwood Computing Limited|Birlasoft 有限公司|Blue Bird Technologies 私人有限公司|Blue Fountain Media 私人有限公司| Blue Star InfoTech|Boden Inc|波士顿|Braahmam Net Solutions 私人有限公司|Braahmam Net Solutions 私人有限公司|Brain Soft 技术私人有限公司|Brigade Corporation 私人有限公司|Business Link Automation India 私人有限公司|BusinessLink Automation 私人有限公司|C Ahead Info Technologies India 私人有限公司|C.D.I Corporation|CCG 印度私人有限公司|CEM 解决方案|CGI 信息系统和管理顾问私人有限公司|CGI 信息系统私人有限公司|CGI 信息系统和管理顾问私人有限公司|CGI 信息和管理私人有限公司|CGI Netvorks|CISCO 系统印度私人有限公司|CMC Limited|COMSYS Inc|CORE SHELL TECHNO LOGIES|CRC Software India private limited|CRV Executive Search 私人有限公司|CS Software Solutions 私人有限公司|CSC India 私人有限公司|CSS Corp 私人有限公司|Cambridge Solutions Limited|Cambridge Solutions|Cambridge Solutions Sdn.有限公司|Candor Ind. private limited|Candor India private limited|Canvas Creatives private limited|Canvera|Capgemini Business Service India Limited|Capgemini private)
我正在使用 C# 来处理这些东西。
请赐教!!!!
【问题讨论】:
标签: c# regex performance c#-2.0