photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Damit on March 21, 2025, 02:52:25 AM

Title: Using only the end of a file name for fiel relations
Post by: Damit on March 21, 2025, 02:52:25 AM
In this topic: Using only a part of the Master file name (https://www.photools.com/help/imatch/rel_config.htm?dl=h-6), the procedure to only include a certain amount of the initial portion of the file name in order to match. I was wondering if there is a reverse of  :n
Something that allows one to only use the end of the file name to match. Something like  :-n

I have discovered that many versions of the file naming system I want to use for my scans are prone to having the initial portion of the file name change, as I want to begin the file names with the date, along with other information that, while pretty stable, may change.  As such, I thought I would create unique numbers I would place at the end of all my scans and use that for relations. I figure they would also be more "secure" from anything that may lead lost relations by using this method. I tried using ^{File.Name|right:5}.*\.jpg$, but that did not work. 
Title: Re: Using only the end of a file name for fiel relations
Post by: Mario on March 21, 2025, 08:38:11 AM
The trick is usually to find the regular expression for the job.
More complex file names require more complex regular expressions.

Start with googling perl regexp part of string and then make some tests with the RegExp Tester app included in IMatch.
Title: Re: Using only the end of a file name for fiel relations
Post by: Damit on March 21, 2025, 01:14:51 PM
Thanks. Oh the joys of the regular expression rabbit hole!  Been down it many times but nothing seems to stick in my memory and I always have to relearn it.