Click here to Skip to main content
15,914,820 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,,,
im validating the email id im getting few errors ,,pls say where im going wrong
BOOL CMailDlg::Validate()  
 {  
 CString m_sFrom;
 CString strRegex;
 System::String strRegex = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}" + "\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\" + ".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";  
 System::Text::RegularExpressions::Regex ^_Regex = gcnew System::Text::RegularExpressions::Regex(strRegex);  
 if (_Regex->IsMatch(m_sFrom))  
 return (true);  
 else 
 return (false);  
 }

errors
error C2653: 'System' : is not a class or namespace name<br />
error C2065: 'String' : undeclared identifier<br />
  missing ';' before identifier 'strRegex'<br />
 error C2110: cannot add two pointers<br />
 error C2653: 'System' : is not a class or namespace name<br />
 error C2065: 'Regex' : undeclared identifier<br />
 error C2065: '_Regex' : undeclared identifier<br />
 error C2065: 'gcnew' : undeclared identifier<br />
 error C2653: 'System' : is not a class or namespace name<br />
 error C2106: '=' : left operand must be l-value<br />
 error C2146: syntax error : missing ';' before identifier 'Regex'<br />
error C2227: left of '->IsMatch' must point to class/struct/union

thank you
Posted
Updated 8-May-11 20:39pm
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900