Question

I used this code for validating email id , im getting few errors i dono how to solve it,,, im new to MFC,, if im silly pls forgive me

BOOL CMailDlg::Validate(CString m_sFrom)
{
  m_sFrom  = NulltoString(m_sFrom);
  CString strRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  

  Regex re = new Regex(strRegex);
  if (re.IsMatch(m_sFrom))
    return (true);
  else
    return (false);
}

Errors:

error C2511: 'Validate' : overloaded member function 'int (class CString)' not found in 'CMailDlg'

see declaration of 'CMailDlg'

error C2059: syntax error : 'bad suffix on number'

error C2018: unknown character '0x40'

error C2017: illegal escape sequence

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top