0

I am doing the following

std::string myregex = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$" boost::regex re; re.assign(regex_expr, boost::regex_constants::icase); //Problem - Breaks 

Any suggestions on what might be wrong with the assign statement

2
  • What is the error shown? Commented Jan 30, 2014 at 4:52
  • @nhahtdh It throws an exception. Commented Jan 30, 2014 at 4:54

1 Answer 1

0

The parser of some regex engines is more nitpicky than the others. However, they generally parse the regex correctly if you put - at the end of a character class.

"^[_A-Za-z0-9+-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$" ^^ 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.