I'm trying to match and break up a typical tv torrent's title:
MyTV.Show.S09E01.HDTV.XviD
MyTV.Show.S10E02.HDTV.XviD
MyTV.Show.901.HDTV.XviD
MyTV.Show.1102.HDTV.XviD
I'm trying to break these strings up into 3 capture groups for each entry: Title, Season, Episode.
I can handle the first 2 easy enough:
^([a-zA-Z0-9.]*)\.S([0-9]{1,2})E([0-9]{1,2}).*$
However, the third and fourth one prove difficult to break apart the season and episode. If I could work backwards it would be easier. For example, with "901", If I could work backwards it would be take the first to digits as the episode number, anything remaining before that is the season number.
Does anyone have any tips for how I can break these strings up into those relevant capture groups?