4
I’m trying to use C++ regex but I’m having some difficulties, one of them is that Pattern was in a C#code, and I know practically nothing of regex in C++, and so the code does not work as it should in C++
Here’s the excerpt of the code that doesn’t work as it should:
if (!std::regex_match("BLUS31029", std::regex("^B[LC][JUEAK][SM]\d{5}$")))
print_error("Invalid game id: " + game_id);
else
::id_ = game_id;
}
PS: I already changed the regex_match
for regex_search
and yet it didn’t work
"does not work" means that some error appears when compiling the program, or the result is not expected? Which compiler you are using?
– Gomiero
@Gomiero It doesn’t work in the sense of giving the expected result q in the case is true, and I’m using Visual Studio 2019
– Luiz Fernando