Help with Match and Replace

A swapping-ground for Regular Expression syntax

Help with Match and Replace

Postby dekela » Tue Jan 01, 2019 2:10 pm

Hi, I would like to rename the following:

Code: Select all
HDTV ??? ???? ???? ????????? ?1 ?61.mp4 to S01.E61.mp4


The number is different in every file name and its the only thing I want to preserve from the original.

Thanks for the help
Dekel
dekela
 
Posts: 1
Joined: Tue Jan 01, 2019 1:51 pm

Re: Help with Match and Replace

Postby bru » Fri Jan 04, 2019 7:28 pm

#1RegexMatch:
.* [^\d]+(\d+) [^\d]+(\d+)$

#1RegexReplace:
S\1.E\2


Enforcing 2Digits requires another-run,
#1RegexMatch:
^(S)(\d\.E\d+)$

#1RegexReplace:
\10\2


(or use BRC/commandline to do both at same time)
bru
 
Posts: 62
Joined: Wed Jan 31, 2018 7:35 pm


Return to Regular Expressions