using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"[a-zA-z]+[.]+[a-zA-z]*[@]eil.co.in";
string input = @" ""ABHAY KUMAR"" <abhay.kumar@eil.co.in>, ""JATINDER S DUGGAL"" <js.duggal@eil.co.in>, ""MAHESH EASWARAN"" <mahesh.easwaran@eil.co.in>, ""MAHESH GUPTA"" <mahesh.gupta@eil.co.in>, ""MUKESH KUMAR"" <mukesh.kumar@eil.co.in>, ""anand yadav"" <anand.yadav@eil.co.in>, ""SANJIT KUMAR KESHRI"" <sanjit.keshri@eil.co.in>, ""PINTU LAL"" <pintu.lal@eil.co.in>, ""SUSHANT CHANDRA SAXENA"" <sushant.saxena@eil.co.in>, ""VIKAS VIKAS"" <vikask@eil.co.in>, ""PRINCE PRINCE"" <prince.gupta@eil.co.in>
Cc: ""NALIN KUMAR"" <kumar.nalin@eil.co.in>";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx