Commit 6a3603b4 authored by fallenstardust's avatar fallenstardust

正则4到9位卡片id

parent 7aef23cf
...@@ -2070,7 +2070,7 @@ std::string WCharToUTF8(const wchar_t* input) { ...@@ -2070,7 +2070,7 @@ std::string WCharToUTF8(const wchar_t* input) {
void Game::AddDebugMsg(const char* msg) { void Game::AddDebugMsg(const char* msg) {
std::string message(msg); std::string message(msg);
unsigned int cardID = 0; unsigned int cardID = 0;
std::regex cardIdPattern(R"((\d{8}))"); std::regex cardIdPattern(R"((\d{4,9}))");
auto words_begin = std::sregex_iterator(message.begin(), message.end(), cardIdPattern); auto words_begin = std::sregex_iterator(message.begin(), message.end(), cardIdPattern);
auto words_end = std::sregex_iterator(); auto words_end = std::sregex_iterator();
for (std::sregex_iterator i = words_begin; i != words_end; ++i) { for (std::sregex_iterator i = words_begin; i != words_end; ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment