Reputation: 760
i m looking for checking emailid in content of message body. i do not want to allow any one to send message that contain email address as a part of message.
so how can i achieve this in asp.net c#??
Please help me if any one has an idea about this !!!
Upvotes: 0
Views: 194
Reputation: 2018
Regex re = new Regex(@"[A-Za-z0-9_\-\.]+@([A-Za-z0-9\-]+\.)+([A-Za-z\-])+");
MatchCollection matches = re.Matches(Text);
foreach (Match s in matches)
{//do whatever with s.Value}
Upvotes: 2