renaming mkv files drop regex suffix -\d{1,2}

Bulk Rename Utility How-To's

renaming mkv files drop regex suffix -\d{1,2}

Postby pasha_19 » Thu Jan 28, 2021 8:17 am

What works for me is setting filter(12) to mask -\d{1,2}\.mkv unchecking folders checking regex, files and subfolders appears to get me the list of files I want to rename. I attempt to enter in Regex(1) match -\d{1,2}\.mkv, replace \.mkv checking Inc. Ext. The problem is the message I get is "There are no selected items that need remaming". What I want to do is strip the -\d{1,2} off the end of the file name keeping the .mkv extension. It is probably a simple change, but what am I doing wrong?

Thanks in advance.
pasha_19
 
Posts: 5
Joined: Sat Jan 16, 2021 2:50 pm

Re: renaming mkv files drop regex suffix -\d{1,2}

Postby Luuk » Thu Jan 28, 2021 8:56 am

The files must be selected to rename. If you like them auto selected, there is "Actions, List, Auto-Select All".
Luuk
 
Posts: 699
Joined: Fri Feb 21, 2020 10:58 pm

Re: renaming mkv files drop regex suffix -\d{1,2}

Postby pasha_19 » Thu Jan 28, 2021 1:23 pm

Actions -> Select all appears to be the appropriate option after getting Filter(12) list to be the select a list.

I changed Filter(12) Mask and RegEx(1) Match to ^(.*)(-\d{1,2})(\.mkv)$ the entire filename (i think). All switches in Filter(12) and RegEx(1) remain the same as above. The (.* ) value could probably be more explicitly limited to eliminate some characters like[a-zA-Z0-9_] with appropriate escape sequences if required hyphen, exclamation point, single quote, parens and square brackets in the list but it appears to work as is -- that can be my problem.

Extension(11) set to Same takes care of the .mkv part of the file name (third subgroup)

What do I put in RegEx(1) Replace to get it to use the first subgroup (.*) as the desired file name? Currently i tried (.*) and all file names become (.*).mkv - clearly I am still making a mistake.

My first attempt with ReGex(1) Match -\d{1,2}\.mkv Replace \.mkv with Inc Ext ON resulted in the name \.mkv.mkv for all files I believe with Extension(11) as Same and \.mkv when Extension[11] was set to Remove.
pasha_19
 
Posts: 5
Joined: Sat Jan 16, 2021 2:50 pm

Re: renaming mkv files drop regex suffix -\d{1,2}

Postby pasha_19 » Thu Jan 28, 2021 2:19 pm

PS Luuk your suggestion helped me get further.
pasha_19
 
Posts: 5
Joined: Sat Jan 16, 2021 2:50 pm

Re: renaming mkv files drop regex suffix -\d{1,2}

Postby Luuk » Thu Jan 28, 2021 2:54 pm

Yes, there can be many ways for selection, but I dont know if asking more questions? If its me, this what I do...
1. First to click "Reset" by Rename, then the Filters(12) is -\d{1,2}\.mkv$ with a checkmark in the "RegEx".
2. Then for RegEx(1), no checkmarks anywhere using
Match...
(.+)-\d{1,2}$
Replace...
\1
The \1 holds everything matched inside (.+)
3. Put checkmark in Renaming Options, Prevent Duplicates in case of many names starting the same?
Luuk
 
Posts: 699
Joined: Fri Feb 21, 2020 10:58 pm

Re: renaming mkv files drop regex suffix -\d{1,2}

Postby pasha_19 » Thu Jan 28, 2021 7:37 pm

Thanks; it looks like the /1 in replace will be my answer. I will try it later, no time now.
pasha_19
 
Posts: 5
Joined: Sat Jan 16, 2021 2:50 pm

Re: renaming mkv files drop regex suffix -\d{1,2}

Postby pasha_19 » Fri Jan 29, 2021 11:11 am

That \1 solved the issue; Thanks
pasha_19
 
Posts: 5
Joined: Sat Jan 16, 2021 2:50 pm


Return to How-To


cron