这是代码:
当有31个团体时会发现:
try
{
regex re("(0)(1)(2)(3)(4)(5)(6)(7)(8)(9)(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)", tr1::regex::icase);
}
catch (regex_error e)
{
std::cout << e.what();
}
Run Code Online (Sandbox Code Playgroud)
但是,我尝试再添加一个组(共32组),oops:
try
{
regex re("(0)(1)(2)(3)(4)(5)(6)(7)(8)(9)(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)", tr1::regex::icase);
}
catch (regex_error e)
{
std::cout << e.what();
}
Run Code Online (Sandbox Code Playgroud)
捕获并打印regex_error异常
正则表达式错误
我在Windows 7上使用VisualStudio 2010
似乎群体有最大限制.我怎样才能突破极限?
我不确定 Windows 版本,但 gcc 版本只有部分支持
http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2011
你正在看的第 28 节。其他语言似乎能够匹配更多的群体
也许尝试不同的引擎?
http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines