I want to get a regular expression that can match a string consisting of a Chinese character and without English or any other character. [\ u4e00- \ u9fa5] does not work at all, and [^ x00-xff] will correspond to the situation with the accent symbol or another language.
boost::wregex reg(L"\\w*"); bool b = boost::regex_match(L"我a", reg); // expected to be false b = boost::regex_match(L"我,", reg); // expected to be false b = boost::regex_match(L"我", reg); // expected to be true
source share