diff --git a/comicfn2dict/parse.py b/comicfn2dict/parse.py index 18a284f..1484637 100644 --- a/comicfn2dict/parse.py +++ b/comicfn2dict/parse.py @@ -145,12 +145,9 @@ class ComicFilenameParser: if not self._unparsed_path: return - # TODO fix REMAINING GROUP_RE to use token delim - tokens = self._unparsed_path.split(_TOKEN_DELIMETER) - - # ASSIGN GROUPS remaining_key_index = 0 unused_tokens = [] + tokens = self._unparsed_path.split(_TOKEN_DELIMETER) while tokens and remaining_key_index < len(_REMAINING_GROUP_KEYS): key = _REMAINING_GROUP_KEYS[remaining_key_index] token = tokens.pop(0) diff --git a/comicfn2dict/regex.py b/comicfn2dict/regex.py index c7272c7..e9c24be 100644 --- a/comicfn2dict/regex.py +++ b/comicfn2dict/regex.py @@ -111,15 +111,15 @@ ORIGINAL_FORMAT_SCAN_INFO_SEPARATE_RE = re_compile( # REGULAR TOKENS 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_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") # LONG STRINGS REMAINING_GROUP_RE = re_compile(r"^[^\()].*[^\)]") - NON_NUMBER_DOT_RE = re_compile(r"(\D)\.(\D)")