The program use standard ECMAScript regular expressions as part of the most advanced options of its built-in file Rename function (F2).
The example in the context menu transforms file names in the form _ABC1234.jpg into 1234_ABC.jpg, something impossibe to do with standard renaming. The {RegEx:...} part defines the various captures (i.e. splits the file name down to various components), the rest, {3}{4}{1}{2}, specifies the how the resulting name should be built from the various captured components.
You can insert any other substitution variable or litteral parts in the template, say
- Code: Select all
{RegEx:(_)?(.*?)(_)?([0-9]+)?$}MyImage#{4}-HasSuffix-{2}
will transform "_ABC1234" into "MyImage#1234-HasSuffix-ABC".
The example regular expression "(_)?(.*?)(_)?([0-9]+)?$" splits the string "_ABC1234" into
0: (_ABC1234)
1: (_)
2: (ABC)
3: ()
4: (1234)
It also splits "ABC_1234" into
0: (ABC_1234)
1: ()
2: (ABC)
3: (_)
4: (1234)
{3}{4}{1}{2} then gives 1234_ABC and _1234ABC, respectively. These are just sample illustrating some manipulations.
Once you have your capture groups set up, it's just a matter of re-assembling the parts as you see fit.
Regular expressions are very powerful and let users create very complex renaming schemes, but the syntax is a bit awkward to say the least... Full documentation here:
http://msdn.microsoft.com/en-us/library/bb982727.aspx.
You don't need the {FileName} part in the template for this to work. The {FileName} variable simply represents the original file name, so you can write "My file is named {FileName}" and this will translate to ""My file is named _ABC1234" as you'd expect.
For readers stumbling on this and wondering what we are talking about, FastPictureViewer Professional supports renaming templates where users can define rename "presets" and apply them quickly with the F2 function key, the standard Windows rename shortcut.
By default the renaming function works as anyone expects: press F2, edit the name, press Enter and you are done. In addition to this standard functionality, the program let users create presets that go far beyond this, for example it is possible to automatically insert the current date or some EXIF information in the new file name, using simple substitution variables like for example "{ISOSpeed}", which will be replaced by a number representing the camera ISO setting. The program also support advanced renaming features involving sophisticated techniques described above.
We have a renaming tutorial online on our help page at
http://www.fastpictureviewer.com/help/.
EDIT: while playing with the renaming template editor I noticed that it did not save the template being edited, in some circumstances. The issue was fixed and the new installers (1.3.173.1) should correct this occasional problem.