Regex Problems with folders/files

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Regex Problems with folders/files

Postby FailStyle » Fri Apr 21, 2017 8:15 pm

I cannot for the life of me figure out how to get a regex to work. I've looked at many examples and answers given here and it's all over my head. I have a large amount of movie files that I need to rename. I have them named USA Title aka World Title Year i.e. "The.Thaw.aka.Arctic.Outbreak.2009". What I need to remove is aka to the first number of the year. So aka*1 or aka*2 . Can anyone help me out?
FailStyle
 
Posts: 6
Joined: Sun Aug 28, 2016 8:26 pm

Re: Regex Problems with folders/files

Postby KenP » Fri Apr 21, 2017 9:06 pm

To be honest I'm not 100% sure I'm understanding correctly, 2 or 3 examples of what you've got and how you want them to be renamed to is always helpful.

This will rename "The.Thaw.aka.Arctic.Outbreak.2009" to "The.Thaw.2009", in other words it will remove everything from the start of "aka" to the year, if that's not what you want give us a couple of examples and we'll try to sort something out for you :wink:

RegEx (1)
Match: (.*)aka.*(\d{4})
Replace: \1\2
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Regex Problems with folders/files

Postby FailStyle » Fri Apr 21, 2017 9:27 pm

Yes, that is EXACTLY what I was asking for! I will try when I get home and report back, thank you so much!
FailStyle
 
Posts: 6
Joined: Sun Aug 28, 2016 8:26 pm

Re: Regex Problems with folders/files

Postby FailStyle » Fri Apr 21, 2017 10:34 pm

Ok, so examples would've been much better and EXACT examples would've been best :P
The code works as it should, but I didn't give exact naming convention. Here is exactly what I have:

The.Thaw.aka.Arctic.Outbreak.2009.1080p.Bluray
The.Invention.of.Lying.aka.This.Side.of.the.Truth.2009.480p.DVD


What I Need is:

The.Thaw.2009.Bluray
The.Invention.of.Lying.2009.DVD

I don't care for the resolution part, but I do need to keep the source (DVD or Bluray). Thank you again for your help already!
FailStyle
 
Posts: 6
Joined: Sun Aug 28, 2016 8:26 pm

Re: Regex Problems with folders/files

Postby KenP » Fri Apr 21, 2017 11:17 pm

This should work.

RegEx (1)
Match: (.*)aka.*(\d{4}\.)(\d*.*\.)?(.*)
Replace: \1\2\4




If you decide you do want to keep the resolution this should work.

RegEx (1)
Match: (.*)aka.*(\d{4}\.)(\d*.*\.)?(.*)
Replace: \1\2\3\4
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Regex Problems with folders/files

Postby FailStyle » Fri Apr 21, 2017 11:58 pm

BEAUTIFUL! That is EXACTLY what I needed. Thank you again so much for your time and effort!
FailStyle
 
Posts: 6
Joined: Sun Aug 28, 2016 8:26 pm


Return to BRU Support