@ -18,7 +18,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex [ ] ReportTitleRegex = new [ ]
{
//Episodes with airdate
new Regex ( @"^(?<title>.+?)?\W*(?<airyear>\d{4})\W+(?<airmonth>[0-1][0-9])\W+(?<airday>[0-3][0-9]) (\W+|_|$)(?!\\) ",
new Regex ( @"^(?<title>.+?)?\W*(?<airyear>\d{4})\W+(?<airmonth>[0-1][0-9])\W+(?<airday>[0-3][0-9]) ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Anime - Absolute Episode Number + Title + Season+Episode
@ -38,15 +38,15 @@ namespace NzbDrone.Core.Parser
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Multi-Part episodes without a title (S01E05.S01E06)
new Regex ( @"^(?:\W*S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,} (\W+|_|$)(?!\\) ",
new Regex ( @"^(?:\W*S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,} ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Multi-episode Repeated (S01E05 - S01E06, 1x05 - 1x06, etc)
new Regex ( @"^(?<title>.+?)(?:(\W|_)+S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,} (\W+|_|$)(?!\\) ",
new Regex ( @"^(?<title>.+?)(?:(\W|_)+S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,} ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Episodes without a title, Single (S01E05, 1x05) AND Multi (S01E04E05, 1x04x05, etc)
new Regex ( @"^(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]|_){1,2}(?<episode>\d{2,3}(?!\d+)))+) (\W+|_|$)(?!\\) ",
new Regex ( @"^(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]|_){1,2}(?<episode>\d{2,3}(?!\d+)))+) ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Episodes with a title, Single episodes (S01E05, 1x05, etc) & Multi-episode (S01E05E06, S01E05-06, S01E05 E06, etc)
@ -54,7 +54,7 @@ namespace NzbDrone.Core.Parser
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Episodes with a title, Single episodes (S01E05, 1x05, etc) & Multi-episode (S01E05E06, S01E05-06, S01E05 E06, etc)
new Regex ( @"^(?<title>.+?)(?:\W+S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:\-|[ex]|\W[ex]){1,2}(?<episode>\d{2,3}(?!\d+)))+) (\W+|_|$)(?!\\) ",
new Regex ( @"^(?<title>.+?)(?:\W+S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:\-|[ex]|\W[ex]){1,2}(?<episode>\d{2,3}(?!\d+)))+) ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Episodes with single digit episode number (S01E1, S01E5E6, etc)
@ -66,11 +66,11 @@ namespace NzbDrone.Core.Parser
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Supports 103/113 naming
new Regex ( @"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+)\d{1})(?<episode>\d{2}(?! p|i|\d+)))+(\W+|_|$)(?!\\) ",
new Regex ( @"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+)\d{1})(?<episode>\d{2}(?! \w|\d+)))+ ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Mini-Series, treated as season 1, episodes are labelled as Part01, Part 01, Part.1
new Regex ( @"^(?<title>.+?)(?:\W+(?:(?:Part\W?|(?<!\d+\W+)e)(?<episode>\d{1,2}(?!\d+)))+) (\W+|_|$)(?!\\) ",
new Regex ( @"^(?<title>.+?)(?:\W+(?:(?:Part\W?|(?<!\d+\W+)e)(?<episode>\d{1,2}(?!\d+)))+) ",
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
//Supports 1103/1113 naming
@ -96,7 +96,7 @@ namespace NzbDrone.Core.Parser
//Anime - Title Absolute Episode Number
new Regex ( @"^(?<title>.+?)(?:(?:_|-|\s|\.)+e(?<absoluteepisode>\d{2,3}))+" ,
RegexOptions . IgnoreCase | RegexOptions . Compiled ) ,
RegexOptions . IgnoreCase | RegexOptions . Compiled )
} ;
private static readonly Regex NormalizeRegex = new Regex ( @"((^|\W|_)(a|an|the|and|or|of)($|\W|_))|\W|_|(?:(?<=[^0-9]+)|\b)(?!(?:19\d{2}|20\d{2}))\d+(?=[^0-9ip]+|\b)" ,
@ -144,6 +144,7 @@ namespace NzbDrone.Core.Parser
foreach ( var regex in ReportTitleRegex )
{
var regexString = regex . ToString ( ) ;
var match = regex . Matches ( simpleTitle ) ;
if ( match . Count ! = 0 )
@ -435,7 +436,7 @@ namespace NzbDrone.Core.Parser
return false ;
}
if ( ! title . Any ( Char . IsLetterOrDigit ) | | ( ! title . Any ( Char . IsPunctuation ) & & ! title . Any ( Char . IsWhiteSpace ) ) )
if ( ! title . Any ( Char . IsLetterOrDigit ) )
{
return false ;
}