Check string if its a filename?

Get help with using AutoHotkey and its commands and hotkeys
Peter2
Posts: 243
Joined: 21 Sep 2014, 14:38
Location: CH

Check string if its a filename?

29 Jul 2019, 03:30

I should check if a string is a path with filename.

Like..

OK:
c:\temp\test.log

Wrong:
c:\temp\test
temp\test.log
c:\\temp\test.log
c:/temp\test.log
c:\temp\test.log txt
... and many others????

Are there some predefined functions in AHK which check (a part) of these possibilities?
Peter (AHK Beginner) / Win 7 x64, AHK Version v1.1.22.xx
Helgef
Posts: 3928
Joined: 17 Jul 2016, 01:02
Contact:

Re: Check string if its a filename?

29 Jul 2019, 04:07

Try splitpath. Edit,
Wildcards (* and ?) and other characters illegal in filenames are treated the same as legal characters
So I guess it isn't suitable. I'm sure someone has a regex for this.

Cheers.

Return to “Ask For Help”

Who is online

Users browsing this forum: aifritz, Flipeador, Sir Teddy the First and 54 guests