Metadata Global Filtering (Regex)

Started by Darius1968, November 30, 2017, 12:03:06 PM

Previous topic - Next topic

Darius1968

I'm applying a global filter, utilizing "Metadata Search" in Regular Expression mode, with "Selected Tags" chosen from the drop-down menu and applied towards the "File Name" tag, with the expression, "\.(gif|jpg)$".  I'm getting no response when I know I have many images of both filetypes!  It seems that the parenthesis () are breaking the engine, but I know from a regular expression tester site that this expression is totally valid.  What response(s) are other users getting? 

thrinn

Looks like a bug to me.
I tried the Filter Panel -> Metadata Search for the same tag as you and also get an empty result set. I used the RegExp \.(pdf|jpg)$.
Note, exactly the same expression works as expected when used with the File Name filter. (By the way, for filtering on file names, I prefer to use the File Name filter instead of Metadata Search.)
So there is an easy workaround, but nevertheless, looks like a bug.
Thorsten
Win 10 / 64, IMatch 2018, IMA

Mario

#2
The Metadata Search Panel uses the Advanced Search engine mode which means that ( and ) and the other listed operators in the Search Engine topic have a special meaning.
This means that

\.nef OR \.jpg

will work in the way you want. Or you need to escape the meaning of the parentheses by wrapping your expression in

"\.(pdf|jpg)$"

You can also do

"\.(pdf|jpg)$" OR beach.*

that way. Or Any of the other advanced search engine expressions.

I've implemented that 3 years ago but in hindsight it may be better to internally disable the advanced search engine if the regexp option is used. People don't read the help and then wonder why they don't get the results they expect. I'm in a continuous process of removing complexity by simplifying things, removing rarely needed features and options.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Aubrey

#3
Quote from: Mario on November 30, 2017, 01:46:02 PM

I've implemented that 3 years ago but in hindsight it may be better to internally disable the advanced search engine if the regexp option is used. People don't read the help and then wonder why they don't get the results they expect. I'm in a continuous process of removing complexity by simplifying things, removing rarely needed features and options.

I figured out the uppercase AND or OR when using the search bar - I don't think REGEX works in search bar - pity!

I didn't realize, or never tried REGEX formulation. Recently I read through Regular Expressions Tutorial:
https://www.regular-expressions.info/tutorial.html

I found it very informative.

It would be a pity to remove REGEX option in the global filtering

If you insist, could we perhaps have an expert switch rather than removing extra options. (Or pay a slightly higher price for a version with extras  ;) - this could then financially help going through extra support time! )

BTW recently I was trying to figure out replacement expression, where I would replace multiple selections in Versioning (in the "replacement expression"). Again buried in the IMatch help file was a note explaining this can be done, with an example. A very comprehensive document. Well done Mario.

In case somebody wants the command I copy from the manual:
You can add multiple replacement expressions: /a/b/c/d/_DSC//   (replace a with b and c with d and _DSC with "nothing")


Aubrey.

Mario

#4
Quote from: Aubrey on November 30, 2017, 04:26:07 PM
I figured out the uppercase AND or OR when using the search bar - I don't think REGEX works in search bar - pity!
Regular Expressions are available. You need to enable them via the drop-down menu of the X button.

Quote from: Aubrey on November 30, 2017, 04:26:07 PM
I didn't realize, or never tried REGEX formulation. Recently I read through Regular Expressions Tutorial:
https://www.regular-expressions.info/tutorial.html
I found it very informative.
Yep. I link to that from the regular expression help topic, when I'm not mistaken.

QuoteIt would be a pity to remove REGEX option in the global filtering

I won't remove the reg exp support.
I have just (for next release) disabled the Advanced Search syntax (which gives ( and ) and some other values a special meaning) when regexp is used.
Since ( and ) are frequent elements i regular expressions it's just simpler that way for the majority of the minority of users who use regular expressions in the Metadata Filter.
This reduces complexity and works more along the way of what users expect when typing a regular expression with ( and ) into this search box.



-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

thrinn

QuotePeople don't read the help and the wonder why they don't get the results they expect.
Mea culpa...  :-[
Thorsten
Win 10 / 64, IMatch 2018, IMA

Darius1968

When you mention the advanced search functionality in the Metadata Search, I can then relate to why you have to use quotes if you use parenthesis, and if you decide to disable it for the next release, I'll then know how to cope.  I just couldn't find it anywhere in the help about the advanced search functionality being up-til-now a default in the metadata search. 

Mario

Until I introduced the simple search for the file window search bar, there was only Advanced Search. One IMatch search engine for everything and with the same syntax, everywhere.
But users did not get along well with that, so I added a simpler mode - for the file window search bar. Advanced is now an option.
For all other features, from apps to the filter panel, the Advanced mode is still the default.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

"For all other features, from apps to the filter panel, the Advanced mode is still the default."
Is this Advanced mode (where an expression:  "Private AND Keywords" is par for the course) also available in the filtering for the category and media & folders panes?  I attempted this without success (got an empty result set), in the category filtering (drop-down set to "Contains").  Also, where Regex is supported in IMatch, are positive/negative lookahead, lookbehind, and lookaround upheld? 

Mario

QuoteIs this Advanced mode (where an expression:  "Private AND Keywords" is par for the course) also available in the filtering for the category and media & folders panes?
No.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook