Hello!

I am having a problem to validate an e-mail with QRegularExpression.

I am trying with me@me.com an it returns false

Qt Code:
  1. bool regExpressionRetorno::validaEmail(QString email)
  2. {
  3. bool retorno = true;
  4.  
  5. qDebug() << email;
  6.  
  7. QRegularExpression regex("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b");
  8.  
  9. if(!regex.match(email).hasMatch())
  10. {
  11. retorno = false;
  12. }
  13.  
  14. return retorno;
  15. }
To copy to clipboard, switch view to plain text mode 

Whats is going wrong?

Thanks in advance.