Complex replace method help

Advanced Renamer forum
#1 : 04/02-16 06:59
Highlander
Highlander
Posts: 2
Hi all.

Amazing utility and I wish I were clever enough to fully exploit all of its potential.

I have the following strings I wish to rename (there's over 4000, but they all follow a similar pattern):


ORIGINAL

10-Yard Fight World set 1 MAME Gameplay video Snapshot -Rom name 10yard-.mp4
88 Games MAME Gameplay video Snapshot -Rom name 88games-.mp4
1943 - The Battle of Midway US Rev MAME Gameplay video Snapshot -Rom name 1943u-.mp4

RENAMED

10yard.mp4
88games.mp4
1943u.mp4

So, ideally, I need to strip out all the text up to up to and including "Rom name", then remove the "-" leaving only the small filename and extension. I would think this is a replace method?

This is way beyond my knowledge of expressions. Can anyone help?

Thanks





04/02-16 06:59
#2 : 04/02-16 10:54
Tester123
Tester123
Posts: 92
Reply to #1:
Try this Replace method:

Text to be replaced: (.+ -Rom name )(.+)-
Replace with: \2
Use regular expressions: Tick
Apply to: Name

Quick summary:
Look for any series of characters (that's what the '.+' is for) that ends with the literal string '-Rom name '.
Store this as group 1 (that's what the first set of brackets are for).
Then look for any any series of characters but stop and don't include the trailing hyphen.
Store this as group 2 (that's the second set of brackets).
Replace the entire filename with the contents of group 2 (signified by '\2').
Bingo!


04/02-16 10:54 - edited 04/02-16 10:57
#3 : 10/02-16 14:14
Highlander
Highlander
Posts: 2
Reply to #2:

Thanks so much for your help and your clear explanation of what each expression is doing - I'm learning slowly!

Thanks again


10/02-16 14:14