using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^[M|m]etalocalypse\ [s|S](\d\d)[e|E](\d\d)";
string substitution = @"Metalocalypse.S\1E\2.XviD";
string input = @"Metalocalypse s03e01.avi
Metalocalypse s03e01.srt
Metalocalypse s03e02.avi
Metalocalypse s03e02.srt
Metalocalypse s03e03.avi
Metalocalypse s03e03.srt
Metalocalypse S03E04.avi
Metalocalypse s03e04.srt
Metalocalypse s03e05.avi
Metalocalypse s03e05.srt
Metalocalypse s03e06.avi
Metalocalypse s03e06.srt
Metalocalypse s03e07.avi
Metalocalypse s03e07.srt
Metalocalypse s03e08.avi
Metalocalypse s03e09.avi
Metalocalypse s03e09.srt
metalocalypse s03e10.avi
Metalocalypse s03e10.srt";
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