I have a class
class C
{
private:
const static std::regex r;
}
and I want to give the variable r some string to parse, as example:
//ATTENTION: IT'S NOT CORRECT, HOW TO DEFINED IT CORRECTLY?
std::regex r("Hello\n");
and I have a function in the same class, where I have multiple if-statements to check if the string is parsed
if(std::regex_match(user_input,r)
{
std::cout << "match";
}
else
{
std::cout << "no match";
}
How can I use r correctly and compare user_input with r, when r has not been defined?