Closed codinasion-bot[bot] closed 2 years ago
private static bool IsValid(string email)
{
string regex = @"^[^@\s]+@[^@\s]+\.(com|net|org|gov)$";
return Regex.IsMatch(email, regex, RegexOptions.IgnoreCase);
}
Hey @fadyfayek11
Could you please raise a PR for this 👍🏻
Description
Write a programme to check a valid email address
A valid email address consists of an email prefix and an email domain, both in acceptable formats.
The prefix appears to the left of the @ symbol.
The domain appears to the right of the @ symbol.
Acceptable email prefix formats
letters
(a-z),numbers
,underscores
,periods
, anddashes
.underscore
,period
, ordash
must be followed by one or moreletter
ornumber
.