diff --git a/comicfn2dict/regex.py b/comicfn2dict/regex.py index e9c24be..7ffbd4b 100644 --- a/comicfn2dict/regex.py +++ b/comicfn2dict/regex.py @@ -113,9 +113,8 @@ ORIGINAL_FORMAT_SCAN_INFO_SEPARATE_RE = re_compile( VOLUME_RE = re_compile(r"((?:v(?:ol(?:ume)?)?\.?)\s*(?P\d+))") # ISSUE -_ISSUE_NUMBER_RE_EXP = r"(?P[\w½]+\.?\d*\w*)" -ISSUE_NUMBER_RE = re_compile(r"(\(?#" + _ISSUE_NUMBER_RE_EXP + r"\)?)") -_ISSUE_RE_EXP = r"(?P[\d½]+\.?\d*\w*)" +_ISSUE_RE_EXP = r"(?P\w*(½|\d+)[\.\d+]*\w*)" +ISSUE_NUMBER_RE = re_compile(r"(\(?#" + _ISSUE_RE_EXP + r"\)?)") ISSUE_END_RE = re_compile(r"([\/\s]\(?" + _ISSUE_RE_EXP + r"\)?(\/|$))") ISSUE_BEGIN_RE = re_compile(r"((^|\/)\(?" + _ISSUE_RE_EXP + r"\)?[\/|\s])") ISSUE_ANYWHERE_RE = re_compile(r"\b(\(?" + _ISSUE_RE_EXP + r"\)?)\b") diff --git a/tests/comic_filenames.py b/tests/comic_filenames.py index 18635c8..79dc507 100644 --- a/tests/comic_filenames.py +++ b/tests/comic_filenames.py @@ -368,6 +368,13 @@ FNS.update( "issue": "1024", "series": "action comics", }, + # This is a contrived test case. I've never seen this I just wanted to handle it with my parser + "Cory Doctorow's Futuristic Tales of the Here and Now #0.0.1 (2007).cbz": { + "ext": "cbz", + "issue": "0.0.1", + "series": "Cory Doctorow's Futuristic Tales of the Here and Now", + "year": "2007", + }, } ) DIFFICULT = { @@ -431,18 +438,10 @@ DIFFICULT = { "title": "Anda's Game", "year": "2007", }, - # This is a contrived test case. I've never seen this I just wanted to handle it with my parser - "Cory Doctorow's Futuristic Tales of the Here and Now #0.0.1 (2007).cbz": { - "ext": "cbz", - "issue": "0.1", - "series": "Cory Doctorow's Futuristic Tales of the Here and Now", - "year": "2007", - "issue_count": "", - }, } -# FNS.update(LATER) - +# first_key, first_val = DIFFICULT.popitem() +# FNS[first_key] = first_val WONFIX = { # Leading issue number is usually an alternate sequence number