1

Boost xpressive (最新バージョン) を使用したこの簡単な例では、次のエラーがスローされますAccess violation reading location 0x000000。エラーは regex_match で発生します。これは単純なものでなければなりませんが、気が狂うまで見てきました。

これが機能しないのはなぜですか?

using namespace boost::xpressive;

std::string hello( "Apple Orange_" );

const boost::xpressive::sregex rex = boost::xpressive::sregex::compile("(\\w+)\\s(\\w+)_"); 

boost::xpressive::smatch what;

if( regex_match( hello, what, rex ) )
{
  std::string s1 = what[0]; // whole match
  std::string s2 = what[1]; // first capture
}
4

0 に答える 0