私は、データストリーム内の興味深いデータならば、いくつかのチャンクに一致するようにしようとしています。なぜregex 'を昇格しないのですか。{2}'は '??'
あり(非shecksumが指定されていない場合又は??
)主要<
次いで4つの英数字、チェックサムの2つの文字であると末尾>
べきです。最後の2つの文字が英数字の場合は、予想通り
は、次のコードは動作します。彼らは??
だが失敗する。
// Set up a pre-populated data buffer as an example
std::string haystack = "Fli<data??>bble";
// Set up the regex
static const boost::regex e("<\\w{4}.{2}>");
std::string::const_iterator start, end;
start = haystack.begin();
end = haystack.end();
boost::match_flag_type flags = boost::match_default;
// Try and find something of interest in the buffer
boost::match_results<std::string::const_iterator> what;
bool succeeded = regex_search(start, end, what, e, flags); // <-- returns false
私は、こうである必要があります示唆してthe documentationで何かを発見していませんでした(NULLと改行すべてが、マッチAIUIでなければなりません)。
だから私は何を見逃していますか?
から削除されますか?鉱山(gcc)は、 "trigraph ??>が}に変換された"という明示的な警告を出します。 – SingerOfTheFall
私は2008年のツールチェーンを使用してVisual Studio 2013を使用しています。 –