photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Darius1968 on December 24, 2017, 07:49:04 AM

Title: Media & Folders Vs. @RFolderRegExp
Post by: Darius1968 on December 24, 2017, 07:49:04 AM
I was seeking the consolidation of files to folders that had both strings of text, "Jackie" & "2017".  For example: 
E:\_01\_Backups\_201309 (C Drive)\00\_Family\_Lawyers\Aligned Partners\Jackie\2017\

I found that a formula category like this isolated the files splendidly: 
"@RFolderRegExp[^(?=.*2017)(?=.*jackie).*$]"

I tried the regular expression that I used in the formula category (^(?=.*2017)(?=.*jackie).*$), in the filtering of the Media & Folders, with Regular Expressions enabled, with the result being that of an empty set. 

Why is it that the same Regex that was perfect for a formula category based on folders, would be useless in the Media & Folders filtering? 
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Mario on December 24, 2017, 09:59:22 AM
IMatch uses PERL regular expression (as implemented by the Boost library), JavaScript uses a different regexp implementation. There may be differences in syntax. Please consult the documentation for each implementation (see links in the IMatch help for PERL, see MDN for JavaScript) to learn about the differences. I'm no regular expression expect and a expression like the one you show is already past anything I've ever needed.
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Darius1968 on December 24, 2017, 06:57:35 PM
Are you saying that between PERL & JavaScript, the filtering in the Media & Folders and the Categories DB views use one kind of Regex, while the Regex for filtering in the search bar, global filtering, as well as in Data Driven/Formula categories, is of the other kind?  When IMatch enumerates the folder structure with a tree in Media & Folders view, deriving it from a regular expression, is the info coming from the same source as when things like Data Driven/Formula categories, search bar/global filtering are in use? 
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Mario on December 25, 2017, 08:49:10 AM
IMatch always uses the same regular expression engine.

I understand from your original post that you use a regular expression in a category and that this gives you a result / no result?
I understand from your original post that you use a regular expression from your script and that this gives you a result / no result?

Show how you call the endpoint in your code.

The syntax for the /folders endpoint for the regexp is

regexp:<where>,<what>

What did you specify for this parameter?
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Darius1968 on December 25, 2017, 11:02:47 AM
You misunderstood my 1st post in that I did not write any script!  That post states that I used a formula category (@RFolderRegExp[^(?=.*2017)(?=.*jackie).*$]), with the regex (^(?=.*2017)(?=.*jackie).*$) as the argument.  This proved very successful in getting me each and every file, and only the files that resided in a folder that had both terms, "2017" & "Jackie" in the path, like "E:\_01\_Backups\_201309 (C Drive)\00\_Family\_Lawyers\Aligned Partners\Jackie\2017\".

If I try to carry this over to the filtering of the Media & Folders view, I have no success in entering "^(?=.*2017)(?=.*jackie).*$" into the text entry box, with "Regular Expressions" enabled. 
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Mario on December 25, 2017, 11:22:47 AM
As far as I recall the filter works on the leaf level. You are probably trying to filter for the entire path. Different things, different purposes.
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: ubacher on December 25, 2017, 07:05:48 PM
Specify to search all metadata. Then the folder is included. I did that recently, that's why I know.
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Darius1968 on December 26, 2017, 06:23:44 AM
Ubacher, "specify to search all metadata", I know, is available if I'm doing a global filtering of my whole database, but where do/can I find this option, if I'm in the Media & Folders view? 
Title: Re: Media & Folders Vs. @RFolderRegExp
Post by: Mario on December 26, 2017, 08:52:10 AM
The search and filter panel in the media and folders via cannot search metadata.
This filter exists to allow a user to quickly find a specific folder in the tree, or to temporarily show only folders containing specific characters to reduce the number of folders displayed.


I have tried the regular expression:

^(?=.*2017)(?=.*jackie).*$

and it finds the folder

D:\data\images\test\Jackie 2017

on my system. It does not find

D:\data\images\test\2017\Jackie

because, as I said above, it only looks at the leaf level ("Jackie 2017" or "Jackie") and not the entire folder path.