From b7b8060ef2d8bbeed94350a441389de0bd4c4b8f Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Wed, 27 Mar 2013 19:20:10 +0000 Subject: [PATCH] Fixed filename parsing to find "AU" issues git-svn-id: http://comictagger.googlecode.com/svn/trunk@551 6c5673fe-1810-88d6-992b-cd32ca31540c --- comictaggerlib/filenameparser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/comictaggerlib/filenameparser.py b/comictaggerlib/filenameparser.py index ab1740d..454d4a0 100644 --- a/comictaggerlib/filenameparser.py +++ b/comictaggerlib/filenameparser.py @@ -112,10 +112,10 @@ class FileNameParser: # first look for the last "#" followed by a digit in the filename. this is almost certainly the issue number #issnum = re.search('#\d+', filename) - matchlist = re.findall("#[-+]?([0-9]*\.[0-9]+|[0-9]+)", filename) + matchlist = re.findall("#[-+]?(([0-9]*\.[0-9]+|[0-9]+)(\w*))", filename)ssss if len(matchlist) > 0: #get the last item - issue = matchlist[ len(matchlist) - 1] + issue = matchlist[ len(matchlist) - 1][0] found = True # assume the last number in the filename that is under 4 digits is the issue number @@ -134,7 +134,7 @@ class FileNameParser: if not found: # try a regex - issnum = re.search('(?<=[_#\s-])(\d+[a-zA-Z]|\d+\.\d|\d+)', filename) + issnum = re.search('(?<=[_#\s-])(\d+[a-zA-Z]+|\d+\.\d|\d+)', filename) if issnum: issue = issnum.group() found = True