How to rename a pattern of "-[random string of characters]"?

Advanced Renamer forum
#1 : 28/09-20 13:28
John Johnson Murray
John Johnson Murray
Posts: 2
Hello. I'm still a bit of a newbie when it comes to regex and AdvancedRenamer itself.
I'm trying to rename some files, for example [1964 Chad Valley Doctor Who Part 2-Oq-T2tyN-AI] and [Doctor Who - Zoe's Happiness-1taJtPsaUJc]. As you can see, after the title itself, there's a - and some jumbled characters, that range from letters (capital or lowercase), numbers and more -.
I'm trying to find a way to take those out and I can't seem to push my brain to reach a solution.

Any help appreciated,

John


28/09-20 13:28
#2 : 28/09-20 14:25
David Lee
David Lee
Posts: 1125
Try...

Replace: [^ ]\K-[^\]]*
With: nothing
Use regular expressions


28/09-20 14:25
#3 : 28/09-20 14:30
John Johnson Murray
John Johnson Murray
Posts: 2
Reply to #2:
Thank you so much, worked like a charm!


28/09-20 14:30
#4 : 28/09-20 14:45
David Lee
David Lee
Posts: 1125
Reply to #2:
... or if you don't want to retain the square brackets...

Replace: \[?(.*?[^ ])-.*
With: \1

This Regex will work on filenames either with or without the brackets.


28/09-20 14:45