Loop (files & folders) - question mark as wildcard

Report problems with documented functionality
Posts: 16
Joined: 01 Feb 2015, 09:11

Loop (files & folders) - question mark as wildcard

14 Feb 2018, 08:47

It seems that if I am using a question mark "?" as a wildcard in the file pattern of a "files & folders" loop, it does not match a dot ".".

Example: C:\Temp\1a.00.txt

this does not work:
Loop, Files, C:\Temp\?????.txt, F

this works:
Loop, Files, C:\Temp\??.??.txt, F

Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Loop (files & folders) - question mark as wildcard

16 Feb 2018, 23:43

AutoHotkey does not do pattern matching of filenames; it is handled by the OS. This is standard Windows behaviour.
Your understanding of the ? is wrong. It does not match simply any single character. Rather it matches any character except .. If there is no character to match (at end of name, or before a .), then ? will match "nothing" without failure.
Source: batch: question mark wildcard not working with dots - Stack Overflow
(But I haven't found any official documentation to substantiate this.)

You may also find that ??????.txt (six question marks) matches, because the file's short name is something like 1A00~1.TXT.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 14 guests