photools.com Community

IMatch Discussion Boards => IMatch Scripting and Apps => Topic started by: ubacher on July 31, 2017, 06:26:46 PM

Title: v1/folders using reg exp. Correct syntax?
Post by: ubacher on July 31, 2017, 06:26:46 PM
I am trying to get the folder(s) whose name contains a certain string (2017 here, for testing)
How do I specify the regular expression correctly?

IMWS.get('v1/folders', {
                    regexp: '{path},'+'2017'
                }).then(function (response) {
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: Mario on July 31, 2017, 06:35:54 PM
What is {path} ?

Remember to take care for any character which has a special meaning in regular expressions, e.g. \ or . etc.
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: ubacher on July 31, 2017, 06:43:08 PM
The instructions say:
QuoteSyntax: {name|path|desc},regular expression. The where part controls to which folder attribute the regular expression is applied. The regular expression is a standard IMatch regular expression.

Sorry - but how do I interpret these instructions? I thought I had to specify to which part the reg exp applies. Thus the {path}.
For testing I chose "2017" to avoid any special characters.
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: Mario on July 31, 2017, 07:10:06 PM
path,<regular expression here>

{a|b|c}   means: Chose one of.
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: ubacher on July 31, 2017, 08:13:08 PM
Thanks. There was no example around to help.
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: Mario on July 31, 2017, 08:47:14 PM
Well. I'm not perfect. If you care to look at the mountain of code and documentation I have created and shipped with IMatch 2017 it is a true miracle that I have not missed more.
Just write a FR for more info, or write the better info yourself and I will incorporate it. If some people would help out with the docs I would welcome it. I'm only human and even my days have only 48 hours.
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: ubacher on August 01, 2017, 07:32:48 AM
I always worry that I might bother you, Mario, with questions that I might have been able to answer myself.
I realize that you are busy and appreciate your answers so much the more.

When I said There was no example around to help. then it was meant as an explanation why I asked.
Title: Re: v1/folders using reg exp. Correct syntax?
Post by: Mario on August 01, 2017, 10:05:14 AM
I'm fleshing out the documentation all the time. There are limits of what I can do directly in the /discover documentation because that it auto-generated.