import re
s=r"""武士彌助_S01E01_浪人.mp4
武士彌助_S01E02_老方法.mp4
武士彌助_S01E03_彌天大罪.mp4
武士彌助_S01E04_漫漫長路.mp4
武士彌助_S01E05_痛楚與鮮血.mp4
武士彌助_S01E06_平衡.mp4"""
ms = r"(?P<t>.+?)_S(?P<s>\d+)E(?P<e>\d+)_(?P<sub>.*?)\s?(?P<f>(?:.(?!\.))+$)"
a = [_ for _ in list(filter(None, s.split('\n')))]
b = ['EP{} {}{}'.format(m.group('e').zfill(2), m.group('sub'), m.group('f')).strip().upper() for m in [re.match(ms,_) for _ in a]]
for _ in zip(a, b):
print('ren "{}" "{}"'.format(_[0],_[1]))