using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(Заявка на забор документов)\n(Имя - )(.*)\n(Фамилия - )(.*)\n(E-mail - )(.*)\n(Мобильный телефон - )(.*)\n(Улица - )(.*)\n(Дом - )(.*)\n(Корпус - )(.*)\n(Строение - )(.*)\n(Квартира - )(.*)\n(Время забора документов - )(.*)\n(Комментарий - )(.*)";
string substitution = @"\1,\3,\5,\7,\9,\11,\13,\15,\17,\19,\21,\23";
string input = @"Заявка на забор документов
Имя - Владимир
Фамилия - Симигин
E-mail - v.simigin@gmail.com
Мобильный телефон - +79141861116
Улица - Большая Черемушкинская
Дом - 20
Корпус - 1
Строение -
Квартира - 34
Время забора документов - 13:00 - 16:00
Комментарий - Код домофона 39ключ7289";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
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