import re
p = re.compile(
    '(^.*?)(?:\\Ws(?:eason )?(\\d{1,2}|[ivxlcdm]{1,5}))?\\Wp(?:art )?(\\d{1,2}|[ivxlcdm]{1,5})\\W(.*$)'
    , re.I)
p.search('miniseries.season 1.part 5.720p.avi').groups()
p.search('miniseries.part 5.720p.avi').groups()
python regex optional capture group