http://programmer-toy-box.sblo.jp/article/14267315.html
もしくは、
「C++ Boostのインストール(Windows + VisualC++ 2008編)」
http://programmer-toy-box.sblo.jp/article/14873765.html
でBoostがインストールされていることが前提です。
SJIS対応です。
#include <iostream>
#include <string>
#include <boost/regex.hpp>
using namespace std;
int main() {
boost::regex r3("^(?:\x83[\x40-\x96])+$");
boost::smatch m3;
string str3 = "ゼンカクカタカナデアル";
if( boost::regex_search(str3, m3, r3) ) {
cout << "すべてが全角カタカナである" << endl;
} else {
cout << "全角カタカナではない文字がある" << endl;
}
return 0;
}