citra: correct regex for matching nickname

This commit is contained in:
liushuyu 2018-05-22 21:39:59 -06:00
parent 72f9142bb1
commit c0f352bc4e
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437

View File

@ -199,7 +199,7 @@ int main(int argc, char** argv) {
address = match[3];
if (!match[4].str().empty())
port = std::stoi(match[4]);
std::regex nickname_re("^[a-zA-Z0-9._- ]+$");
std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
if (!std::regex_match(nickname, nickname_re)) {
std::cout
<< "Nickname is not valid. Must be 4 to 20 alphanumeric characters.\n";