photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: ubacher on February 04, 2015, 04:43:16 AM

Title: Scripting help pls: Getfiles with fully qualified name + regexp
Post by: ubacher on February 04, 2015, 04:43:16 AM
searchname = "DSCF0044"
Set tmp = Database.GetFiles(searchname+"(.jpg|.dng)",True)

'Above gives no error

searchname = "D:\Foto Cache\2015-01-11 PHILIPPINES\2015-01-28 LINGAYEN\test2\DSCF0044"
Set tmp = Database.GetFiles(searchname+"(.jpg|.dng)",True)

This returns: (10090)ActiveX Automation Error "The parameter is incorrect"

What am I doing wrong?
Title: Re: Scripting help pls: Getfiles with fully qualified name + regexp
Post by: ubacher on February 04, 2015, 06:19:45 AM
Answer:
I have to replace the "\" by "\\" in my search string in order to have a valid regular expression.

( I finally did remember that I had some kind of error with GetFiles before : topic 2379.
That topic gave me the necessary hint.)