Rename scripting question

I am new to using the advanced features of the rename dialog, so I was wondering if someone here could help me figure out how to do this.

I have a 100's of vacation photos that my family sent me with names like this:

[2011.10.05]Rocky_Mountain_001[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.06]Rocky_Mountain_005[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.09]Rocky_Mountain_012[Canon.EOS.Rebel.XS.EF-S].jpg

etc.

What I'm trying to do is get the filenames like this without changing the numbers of the pictures:

001 (2011.10.05).jpg
005 (2011.10.06).jpg
012 (2011.10.09).jpg

I've tried looking at the Regular Expression Syntax page, but have not gotten it close to doing what I want.
I thought something like this might work, but it doesn't give me anything at all:

Old name: [(.)]_(\d).(.)
New name: \2 (\1).\3

Any ideas on how to do this?

[quote="jmaeshawn"]Old name: [(.)]_(\d).(.)
New name: \2 (\1).\3[/quote]You forgot the \ before the [ and ], it indicates they are not used as special characters
The period is a special character also so the expression (..) uses the same system, . means a period and the following period is any characters since there is not a backslash before it.
You used also _
which means there is 0 to unlimited underscore. You miss the dot character which means any characters.
the (\d+) means 1 or more digit characters

Old name: [(.)].(\d+).(..)
New name: \2 (\1)\3

or the way you wrote it
Old name: [(.)].(\d+)..(.)
New name: \2 (\1).\3

from the help file:

[quote="help file"]* = 0 or more of previous expression.
Matches zero or more occurrences of the previous expression. Combine with . to form the "match anything" token (.*).

. = Any single character.
The period (full stop) is used to match any single character.

+ = 1 or more of previous expression.
Matches one or more occurrences of the previous expression.[/quote]

That works great, kakartha, thanks! :slight_smile:

However, upon getting it to work with your help, I've found a new problem.

The new script works on files like these:
[2011.10.05]Rocky_Mountain_001[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.06]Rocky_Mountain_005[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.09]Rocky_Mountain_012[Canon.EOS.Rebel.XS.EF-S].jpg

and successfully turns them into this:
001 (2011.10.05).jpg
005 (2011.10.06).jpg
012 (2011.10.09).jpg

But I've found that about a fourth of the pictures won't get renamed because they are mixed in like this:
[2011.10.05]Rocky_Mountain_001[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.06]Rocky_Mountain_005[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.09]Rocky_Mountain_012[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.05]Rocky_Mountain_019[Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.06] Rocky Mountain 025 [Canon.EOS.Rebel.XS.EF-S].jpg
[2011.10.09] Rocky Mountain 032 [Canon.EOS.Rebel.XS.EF-S].jpg

The script works on the ones with underscores, but ignores the ones with spaces. Is there a way to have the script match both kinds of sets at the same time?
Like:
Old name: [(.)].(\d+).(..) and [(.)]. (\d+) .(..)
or something?

Yep, you need to use

[quote="help file"]| = Alternation (logical or).
The vertical bar is used to separate two or more characters or expressions, any of which may match.[/quote]
so
Old name: [(.)].[|\s]/b[b][|\s]..(.)
New name: \2 (\1).\3

you an observe "[" and "]" are used as special characters

Alternation is not used inside of character ranges [ and ]. Just use:

[_\s]

ooops, thanks MrC, it seems I need to edit now some button I have made before to fix this mistake :stuck_out_tongue:

Hello,

Old Name: [(.)].(\d{3}).(..)
New Name: \2 (\1)\3

Or to those who are more familiar with the ( beautiful -- my opinion only ) original Henry Spencer Code.

Old Name: [(.)].([0-9][0-9][0-9]).(..)
New Name: \2 (\1)\3

Regards