using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(BEGIN:VEVENT\n|(?!^)\G)(?:([A-Z;-]+)[:=][^\n]+)";
string substitution = @"";
string input = @"BEGIN:VEVENT
SUMMARY:Marché légumes Dilbeek et bibliothèque#DTSTART;TZID=Europe/Paris:20130928T084500
DTEND;TZID=Europe/Paris:20130928T094500
DTSTAMP:20160126T214559Z
UID:aHR0cHM6Ly8xOTIuMTY4LjEuMjIwOjQ0MzIvb3duY2xvdWQvcmVtb3RlLnBocC9jYWxkYXYvY2FsZW5kYXJzL2FuZ2Vsby9kZWZhdWx0Y2FsZW5kYXIvOTkwM2QyNTctZjY2Ny00ZWI3LWFjZDEtNWJlZmI0NGQ0MmJlLmljcw==@google.com
RECURRENCE-ID;TZID=Europe/Paris:20130928T090000
SEQUENCE:1
CREATED:20160126T214559Z
LAST-MODIFIED:20160126T214559Z
STATUS:CONFIRMED
TRANSP:OPAQUE
END:VEVENT";
Regex regex = new Regex(pattern);
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