Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Open C/C++: 使用正则表达式的缓慢问题

From Wiki
Jump to: navigation, search

Archived.png存档: 这篇文章是存档,因为考虑到今天它与第三方开发者建立商业解决方案不相关。

  • 详细描述


  regex_t preg;
char* str = "";
char* pattern = "([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})";
int rc;
size_t nmatch = 5;
regmatch_t pmatch[5];
//the next line will take 30-60 seconds to evaluate
if (0 != (rc = regcomp(&preg, pattern, REG_EXTENDED )))
printf("Regular expression compiling failed");
int c = getchar();
return false;

解决方案 最新版本的Open C/C++插件修正了这一问题

This page was last modified on 17 October 2013, at 05:00.
79 page views in the last 30 days.