using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".*(FunFehlerButton: Execute).*";
string substitution = @"$1";
string input = @"INFO: Device 6: Time 20.11.2015 06:28:00 - [Script] FunFehlerButton: Execute [0031 text]
INFO: Device 0: Time 09.12.2015 03:51:44 - [Replication] FunFehlerButton: Execute
INFO: Device 6: Time 20.11.2015 06:28:00 - FunFehlerButton: Execute";
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