Renaming TV Series (Delete everything after SxxExx)

A swapping-ground for Regular Expression syntax

Renaming TV Series (Delete everything after SxxExx)

Postby gr8 » Thu Oct 17, 2019 9:22 am

Hi

I have a bunch of tv series I would like to rename.
I would like to delete everything after the SxxExx.

19-2 S04E01 - Der falsche Schuldige.mkv to 19-2 S04E01.mkv
24 Hours – Two Sides of Crime S01E04 - .mkv to 24 Hours – Two Sides of Crime S01E04.mkv
American Horror Story S07E05 - Löcher.mkv to American Horror Story S07E05.mkv

I have tried one hour now without any success. Can someone please help. Thanks!
gr8
 
Posts: 6
Joined: Sun Nov 09, 2014 8:06 am

Re: Renaming TV Series (Delete everything after SxxExx)

Postby gr8 » Thu Oct 17, 2019 9:30 am

Hi (i hope it's better readable)

I have a bunch of tv series I would like to rename.
I would like to delete everything after the SxxExx.

19-2 S04E01 - Der falsche Schuldige.mkv ----> 19-2 S04E01.mkv
24 Hours – Two Sides of Crime S01E04 - .mkv ----> 24 Hours – Two Sides of Crime S01E04.mkv
American Horror Story S07E05 - Löcher.mkv ----> American Horror Story S07E05.mkv

I have tried one hour now without any success. Can someone please help. Thanks![/quote]
gr8
 
Posts: 6
Joined: Sun Nov 09, 2014 8:06 am

Re: Renaming TV Series (Delete everything after SxxExx)

Postby therube » Thu Oct 17, 2019 11:58 am

1:RegEx
Code: Select all
Match:  (.*S\d+E\d+)\s-\s
Replace:  \1


Match everything up to 'S' followed by 1 or more digits, followed by 'E', followed by 1 or more digits, followed by a <space><dash><space>, only retaining everything up to the <space><dash><space>.

If there are always two digits, you could use \d\d instead of \d+.
If <space><dash><space> is not a constant, or if it might only be <space><dash>, you could change it to that.
Or if <space><dash> were not there at all, you could leave that part out entirely & you'd still probably be OK.
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Renaming TV Series (Delete everything after SxxExx)

Postby gr8 » Thu Oct 17, 2019 12:07 pm

thanks, that did the job!
gr8
 
Posts: 6
Joined: Sun Nov 09, 2014 8:06 am


Return to Regular Expressions