タグ

ブックマーク / www.kmonos.net (1)

  • letsboost::regex

    sample サンプルの動作確認バージョン [GCC4.4/1.41.0] [VC9/1.41.0] #include <iostream> #include <string> #include <boost/regex.hpp> using namespace std; int main() { // <で始まって>で終わる文字列にマッチする正規表現で検索 boost::regex r( "<[^>]+>" ); boost::smatch m; string str1 = "The HTML tag <title> means that ..."; if( boost::regex_search(str1, m, r) ) { cout << "found (pos=" << m.position() << ")" << endl; cout << " ==> " << m.str()

  • 1