Are named subexpressions supposed to be working with regex ICU wrappers? It looks like they are not. For example the code:
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" ];
crashes due to de-referencing empty shared pointer. More specifically the pointer to the regex's named sub-expressions is not transferred to mr (the match_result) from the ICU wrapping code. The simple addition:
mr.set_named_subs( someRegex.get_named_subs() );
after successful search()/match() fixes it for me, but this line calls 2 private implementation specific methods, that just happen to be in the public part of the classes. I'm using boost 1.64 right now, but I suspect this is not related to particular version.
Are named subexpressions going "out of fashion" in boost regex, since AFAIK the standard does not have such? That would be bad news for me.