std::string utf8String(input, length);
std::regex regexPattern("^[a-zA-Z0-9!@#$%^&*()-_+=]{6}$"); (if you want specific special characters).
or
^[a-zA-Z0-9\W]{6}$ (if you meant any 6 characters including symbols).
try { std::regex_match(utf8String, regexPattern); }
catch (const std::exception& e) { return false; }