Warum analysiert dieses Regexmuster die Zeichenfolge "Season 02 Episode 01" nicht richtig?Regex Problemanalyse Saison/Episodenmuster
Zum Beispiel ist dies kein Spiel:
var fileName = "Its Always Sunny in Philadelphia Season 02 Episode 01 - Charlie Gets Crippled.avi"
// Regex explanation:
// Starts with "S" and can contain more letters, can continue with space, then contains two numbers.
// Then starts with "E" again and can contain more letters, can continue with space, then contains two numbers.
var pattern = @"S\w?\s?(\d\d)\s?E\w?\s?(\d\d)";
var regex = new Regex(pattern, RegexOptions.IgnoreCase);
var match = regex.Match(fileName);
Sie haben absolut Recht, das war mein Fehler. Dies ist das festgelegte Muster: 'var pattern = @" S \ w * \ s * (\ d \ d) \ s * E \ w * \ s * (\ d \ d) ";'. –