I want to extract email " myemail [at] domainemail [dot] com " from html code in string.
So I used this code but it is not working. What should I do ?
public static List<string> Fetch_Emails(string Sourcecode)
{
List<string> Emails = new List<string>();
Regex exp = new Regex("\\b[A-Z0-9._%+-]+(\\[at\\])[A-Z0-9.-]+(\\[dot\\])[A-Z]{2,4}\\b", RegexOptions.IgnoreCase);
MatchCollection matchCollection = exp.Matches(Sourcecode);
foreach (Match m in matchCollection)
{
if (!Emails.Contains(m.Value))
{
Emails.Add(m.Value);
}
}
return Emails;
}