Regex fixes to resolve issue #10

This commit is contained in:
echel0n 2014-03-20 11:06:24 -07:00
parent 10637f8f29
commit 9ba772ba44
1 changed files with 1 additions and 6 deletions

View File

@ -194,12 +194,7 @@ def isGoodResult(name, show, log=True):
escaped_name = re.sub('\\\\[\\s.-]', '\W+', re.escape(curName))
if show.startyear:
escaped_name += "(?:\W+" + str(show.startyear) + ")?"
curRegex = '^' + escaped_name + '\W+(?:(?:S\d[\dE._ -])|' \
'(?:\d\d?x)|' \
'(?:\d{4}\W\d\d\W\d\d)|' \
'(?:(?:part|pt)[\._ -]?(\d|[ivx]))|' \
'Season\W+\d+\W+|E\d+\W+)|' \
'((.+)[. _-]+)(\d{1,2}[a-zA-Z]{2})[. _-]+([a-zA-Z]{3,})[. _-]+(\d{4})*(.+)([. _-])()((([^- ]+))?)?$'
curRegex = '^' + escaped_name + '\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))'
if log:
logger.log(u"Checking if show " + name + " matches " + curRegex, logger.DEBUG)