Regular Expressions

Started by zematima, February 24, 2016, 04:45:00 PM

Previous topic - Next topic

zematima

Hi:
I put some words in some files on the Description field.
For instance:

Landscape;Lisbon;Sea (5 photos)
Landscape;Oporto;Town (10 photos)
Landscape;Erra;Construction;House (3 photos)

If I put on the filter panel / Search for metadate choose regular expression over the tag Description, Landscape|House and I got as a result 18 photos.
The same with Landscape|Sea (18 photos)
So what regular expression should i use to find all the photos that have Landscape and House , or Ladscape and Sea?
Thanks in advance,
JRosa.





sinus

Can you not simply use the syntax, like in the help-file described?

for example (from the helpfile):

When you specify multiple words, e.g.

beach clubthe search engine looks for exactly the given term. It will find "A day at the beach club" but not "Daytona beach" or "club hopping".

OR
To find all files either containing the word "beach" or the word "club" you use the OR operator:

beach OR clubAll Boolean operators must be written in upper-case and separated by a single space on each side from the other parts of your pattern.

AND
To find all files containing the word beach and the word "club" you use the AND operator:

beach AND clubNOT
To find all files containing the word beach but not the word "club" you use the AND NOT operator:

beach AND NOT clubUsing ( and )
Sometimes it may be required to specify an operator precedence when using complex search terms with multiple Boolean operators. In this case you can use parentheses to tell IMatch exactly what you mean:

beach OR sun AND club
beach OR (sun AND club)are two different expressions.

Using Quotes
If your search term contains OR, AND or NOT in upper-case, you can use quotes:

"TO BE OR NOT TO BE"Since you have quoted the phrase, IMatch searches for "to be or not to be" and does not consider OR and NOT as Boolean operators. Note that you need quotes only when the operator is written in all upper-case. "or" or "Or" or "oR" are not considered as operators.


The AND/NOT Mode
By default, the search engine applies the Boolean operators to the same tag. Consider a file with the following metadata:

Tag Value
Description This image was taken at the big pool party at the beach club. We had a lot of fun that day.
Make Nikon
Model D600
Keywords beach
club
fun
pool
party
family
friends
vacation
caribbean



You search for Result
pool party Success. The term pool party is contained in the description.
Nikon Success. The term Nikon is contained in the Make value.
beach OR club Success. Both words are contained in the description and also in the keywords.
beach AND club Success. Both words are contained in the description.
Nikon AND D300 Fail. The words Nikon and D300 are in different tags.
family AND vacation   Fail. The words family and vacation are in different keywords. 



Best wishes from Switzerland! :-)
Markus

zematima

#2
Hi:
Thanks for your answer.
I have already read the help file but I can't figure it out.
Where do I put Landscape and House? (Makes sense to put Ladscape and house because it should find on the description field those words)
On the "Search the file window" or on the filter panel /metadata search / Regular expression (Contains?) Landscape and House ?
In both environments doesn't return any image.
Thanks in advance,
JRosa.

Note:
I think I found the problem. It works both ways but the operator must be AND not and...
Thanks again.



sinus

Quote from: zematima on February 24, 2016, 05:20:39 PM
Hi:
Thanks for your answer.
I have already read the help file but I can't figure it out.
Where do I put Landscape and House? (Makes sense to put Ladscape and house because it should find on the description field those words)
On the "Search the file window" or on the filter panel /metadata search / Regular expression (Contains?) Landscape and House ?
In both environments doesn't return any image.
Thanks in advance,
JRosa.

Note:
I think I found the problem. It works both ways but the operator must be AND not and...
Thanks again.

that is correct, AND and OR must be in big letters...
Best wishes from Switzerland! :-)
Markus

Carlo Didier

Quote from: sinus on February 24, 2016, 06:02:01 PM
... AND and OR must be in big letters...

AAAAARRRRRGGGGGHHHHH
I absolutely HATE case-sensitivity (except in paswords, of course)
(sorry for the rant, but I couldn't resist)

sinus

Quote from: Carlo Didier on February 29, 2016, 10:18:00 AM
Quote from: sinus on February 24, 2016, 06:02:01 PM
... AND and OR must be in big letters...

AAAAARRRRRGGGGGHHHHH
I absolutely HATE case-sensitivity (except in paswords, of course)
(sorry for the rant, but I couldn't resist)

hi carlo
you wrote AAAAARRRRRGGGGGHHHHH and notz aaaaarrrr...
So there seems to be also a difference betwen these letters.
With case-sensitivity we can express so fine HATE and love  ;D

Sorry, could not resist  :-[ :-\ 8)
Best wishes from Switzerland! :-)
Markus

Carlo Didier

Quote from: sinus on February 29, 2016, 10:35:25 AM
hi carlo
you wrote AAAAARRRRRGGGGGHHHHH and notz aaaaarrrr...
So there seems to be also a difference betwen these letters.
With case-sensitivity we can express so fine HATE and love  ;D

Sorry, could not resist  :-[ :-\ 8)

Good catch  8)

Mario

Quote from: Carlo Didier on February 29, 2016, 10:18:00 AM
AAAAARRRRRGGGGGHHHHH
I absolutely HATE case-sensitivity (except in paswords, of course)
(sorry for the rant, but I couldn't resist)

The Boolean operators AND and OR use all-upper case to allow you to express things like

Me and IMatch AND team

which means

"Me and IMatch" AND "team"

and not

"Me" AND "IMatch" AND "team"

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

Carlo Didier

Quote from: Mario on February 29, 2016, 10:53:59 AM"Me and IMatch" AND "team"
which is what I would use anyway as it is the only clear and unambigous way to express it.

Mario

The " are for clarification, the are not part of the expression or evaluated.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook