Hi,
You can use regular expression to parse the content of paragraph, you can use the code below,
MatchCollection matchEmails=Regex.Matches(STRING_TO_MATCH, @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", RegexOptions.Compiled | RegexOptions.Multiline);
MatchCollection matchPhones = Regex.Matches(STRING_TO_MATCH, @"[2-9]\d{2}-\d{3}-\d{4}", RegexOptions.Compiled | RegexOptions.Multiline);
You will find matched emails in
matchEmails
and matched phone number in
matchPhones
.