Thursday, July 18, 2019

Validate Email in C# using Regular Expression

public Boolean Email(string str)
  {

   if (Regex.IsMatch(str, @"^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$"))
   {
    return true;
   }
   else
   {
    return false;
   }
        
  }

No comments:

Post a Comment

Lab 09: Publish and subscribe to Event Grid events

  Microsoft Azure user interface Given the dynamic nature of Microsoft cloud tools, you might experience Azure UI changes that occur after t...