Regular Expressions in Master Expression

Started by J.D. McDowell, January 19, 2014, 06:10:21 AM

Previous topic - Next topic

J.D. McDowell

I've been trying for weeks to create a Master Expression in file relations that will allow linking with the Exif timestamp, but only from two folders with recursive selection within those.

My folder structure is

R:\Pics - iMatch Internal Raid
   --The Library
      –1 Libraries
      –2 Working
      –3 Archive

I'd like only files copied (with the renamer) to either the "1 Working" or "2 Archive" directories to link via Exif timestamp to the files in the "1 Libraries" folder. The copied files are the new masters as they are the edited files. The original unedited version is left in the Libraries folder.

Telling file relations to only look in the "Libraries1" (and subdirectories) is easy. It was specifying the folders to start from that I found tricky. (I'm a little green at this.)

Since I finally got it I thought I'd share, perhaps this will be useful to someone. The Master Expression is

^(R\:\\Pics - iMatch Internal Raid\\THE LIBRARY\\(2 Working|3 Archive))(.)*\.(nef|nrw)$

The ^ states the path should start with "R:\Pics - iMatch Internal Raid\THE LIBRARY\2 Working" or "R:\Pics - iMatch Internal Raid\THE LIBRARY\3 Archive" (either sub folder specified by (2 Working|3 Archive) )

(.)+ states any character any number of times, so whatever path, subfolders, there are under either of the two folders selected above, there is no restriction at this point.

\.(nef|nrw)$ , the original default expression, states any file that ends with nef or nrw.

J.D. McDowell

It seems maybe I spoke too soon.

I'll keep working on it.


The master and link expressions only work on the file name, not on the location (folder) of the file.

When IMatch creates relations for a given folder "A", it checks the master expression for each file in that folder to tell if the file is a master.
If a master is found, IMatch scans the folder(s) given in the link expression for all files which are a version of the master.
If you link via the Exif timestamp, IMatch compares the EXIF timestamp of each file in the link folders.
If you link via the file name, IMatch matches the regular expression given in the link with each file name in the link folders.

-- Mario
IMatch Developer
Forum Administrator  -  Contact & Support - Follow me on 𝕏 - Like on Facebook