Extract Season and Episode from Filename

Hi folks, great application, really powerful... I am afraid I must draw on your expertise however, I have an action group that takes mp4 filenames and extracts TVSHOW, ARTIST, TITLE etc. I want to extract the season and episode number too. It is a well known format

The Vampire Diaries S01E16 Hdtv Xvid-Notv.mp4


$1 is the programme name
$2 I use as the title (sometimes it's the title sometimes its not as above).

what variable can I use to get at the S01E01 values? I am not certain what or how $regexp determines the returned parameter values? Any help greatly appreciated.


Just add more sets of parentheses:


They're numbered from left to right, so with the above regex you now have:

$1 is the program name
$2 is the season
$3 is the episode
$4 is the title

Brilliant, works like a charm. Thanks.