string str bla bla bla Company xxx Parent contact account lead data Co

1
2
3
4
5
6
7
8
string str = "** bla ** bla ** bla Company : xxx \n\n ** \n Parent contact/account/lead data : \n Company : test \n Company Type : test type \n *** bla bla bla";
//string str = " bla bla bla \n\n ** \n Parent contact/account/lead data : \n Company : test \n Company Type : test type \n *** bla bla bla";
Regex regex = new Regex(@"Parent contact/account/lead data : [\n ]* Company : ([\w \n]+) Type : ([\w \n]+)", RegexOptions.IgnoreCase);
string str1 = regex.Replace(str, "Parent contact/account/lead data : Company : " + "other company" + " Type : " + "other type");
Console.WriteLine(str1);
Console.ReadLine();