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:
[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]
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?
[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