using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(.+?)(?: - [^-]*?)?(?: #\d*)?(?: v\d+.*)?(?: v\d+.*)?(?: \d+.*)?(?: *\(.*?\))?\..+$";
string substitution = @"$1";
string input = @"Danger_Unlimited(2009).cbr
Danger_Unlimited (2009).cbr
Bear Pirate Viking Queen v01 (2024) (Digital) (DR & Quinch-Empire).cbrxx
Daken-X-23 - Collision (2011) GetComics.INFO.cbr
Dalek Chronicles.cbr
47 Decembers #001 (2011) (Digital) (LeDuch).cbz
Adventures_of the Super Sons v02 - Little Monsters (2019) (digital) (Son of Ultron-Empire).cbr
001 (2022) (3 covers) (Digital-Empire).cbr";
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