Should i ignore warnings on regex declaration
I have the following declaration
Code:
/* Validate RSA cell/toll-free number */
bool Rental::cellNoValidator(const std::string& cn)
{
static const boost::regex e("[0|\+27]+[1234][123][-| ]?[0-9]{3}[-| ]?([0-9]{4})$");
return regex_match(cn, e);
}
/* Validate RSA land line number */
bool Rental::landLineValidator(const std::string& lndln)
{
static const boost::regex e("[0|\+27]+[78]([01234]|[68])[-| ]?[0-9]{3}[-| ]?([0-9]{4})$");
return regex_match(lndln, e);
}
Here are the warnings ..
Code:
: warning C4129: '+' : unrecognized character escape sequence
: warning C4129: '+' : unrecognized character escape sequence
My validation is not working well. I used Regex online test and these Expressions work well, but not on C++