17-10-12, 06:14 PM
كاتب الموضوع : Boutemine Oualid
السلام عليكم و رحمة الله و بركاتهسي شارب
كود :
private bool ValidMail(string mail_address)
{
Regex myRegex = new Regex(@"^([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})(\]?)$", RegexOptions.IgnoreCase);
return myRegex.IsMatch(mail_address);
}كود :
Private function EmailValide(ByVal mail_address As String) As Boolean
Dim rexp as new Regex("^([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})(\]?)$", RegexOptions.IgnoreCase)
Return rexp.IsMatch(mail_address)
End Function