「C++ Boostのインストール(Windows + VisualC++ 2008編)」でBoostがインストールされていることが前提です。
SJIS対応です。
#include <iostream>
#include <string>
#include <boost/regex.hpp>
using namespace std;
int main() {
boost::regex r2("^(?:\x82[\x9F-\xF1])+$");
boost::smatch m2;
string str2 = "ひらがなである";
if( boost::regex_search(str2, m2, r2) ) {
cout << "すべてが平仮名である" << endl;
} else {
cout << "平仮名ではない文字がある" << endl;
}
return 0;
}