string text = "Please contact us by phone (+001 222 222 222) or by email at [email protected] or at [email protected]. This is not email: test@test. This also: @gmail.com. Neither this: [email protected].";
string format = "^[a-zA-Z]{1,15}.[a-zA-Z]{1,15}@[a-zA-Z]{1,10}.(com|in|org|co|uk).(uk)$";
MatchCollection first = Regex.Matches(text, format, RegexOptions.None);
Console.WriteLine(first[0]);
Console.WriteLine(first[1]);
My xpected output is [email protected] and [email protected]..
But i am not getting pls help
Rajneesh ChaubeyPosted Apr 9, 2018, 2:02 AM