Scripting help pls: Getfiles with fully qualified name + regexp

Started by ubacher, February 04, 2015, 04:43:16 AM

Previous topic - Next topic

ubacher

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?

ubacher

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.)