Move "The", preserve Year

A swapping-ground for Regular Expression syntax

Move "The", preserve Year

Postby dalben » Wed Jan 02, 2013 8:37 am

I'll start another thread as the last got no reply.

I need to do the following:

"The Filename.ext" to "Filename, The.ext" and "The FIlename (1234).ext" to "Filename, The (1234).ext"

I can handle it when the titla has no (Year) in it. But when it has the (Year) I'm coming unstuck.

FWIW, I'm using the following to move "The" to the end of the title:
Code: Select all
Find: ^(The)\s(.+)$
Replace: \2, \1
dalben
 
Posts: 5
Joined: Thu Jan 26, 2012 8:38 am

Re: Move "The", preserve Year

Postby Stefan » Sun Jan 20, 2013 1:47 pm

I think you will need two rules for the two different group of file name patterns.

FROM:
"The FIlename (1234).ext"
TO:
"Filename, The (1234).ext"

USE RegEx
Find: ^(The) (.+) (\(\d\d\d\d\))$
Replace: \2,\1 \3



.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Move "The", preserve Year

Postby dalben » Mon Jan 21, 2013 8:59 am

Thanks
dalben
 
Posts: 5
Joined: Thu Jan 26, 2012 8:38 am


Return to Regular Expressions