使用ICU的Boost :: regex不能与命名子表达式一起使用?

时间:2017-07-14 01:49:11

标签: c++ boost icu boost-regex

命名的子表达式应该与正则表达式ICU包装器一起使用吗? 看起来他们不是。例如代码:

Intent intent = new Intent(this, MyReceiver.class); // You wanted receiver

// PendingIntent was created in such a way 
// you wanted this to be received by an activity. 
// you will not receive any call if you set it up like this.
PendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_*); 
由于取消引用空共享指针而导致

崩溃。 更具体地,指向正则表达式的命名子表达式的指针不从ICU包装代码传送到mr(match_result)。 简单的补充:

boost::u32regex someRegex = boost::make_u32regex( "(?<subExprName>.*)$" );
boost::match_results<std::string::const_iterator> mr;
if( boost::u32regex_search( "sometext", mr, someRegex ) )
    auto subExpr = mr[ "subExprName" ];

成功搜索后()/ match()为我修复了它,但是这行调用了2个私有实现特定方法,恰好在类的公共部分。我现在正在使用boost 1.64,但我怀疑这与特定版本无关。

被命名的子表达式已经过时了#34;在boost regex中,既然AFAIK标准没有这样的?那对我来说是个坏消息。

0 个答案:

没有答案