Jump to content

Where can I find more information on WildCards?


Recommended Posts

I've searched the AutoIt.chm file and I can't seem to find information on WildCards like this help file suggests. Am I missing something?

_FileListToArray
...
$sFilter -  [optional] the filter to use, default is *. Search the AutoIt3 helpfile for the word "WildCards" For details.
...
Link to comment
Share on other sites

Also search the Internet to get familiar with 'Wildcards' as well. Though I agree, the AutoIt help is packed with tons of advice.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

The references are there. Make sure you have the correct help file and use the search tab, and not the Index.

I'm searching for "WildCards", I'm using the Search tab, and I'm using "AutoIt Help" that SciTE opens via F1 so I'm not sure that I'm doing anything wrong. I've performed a number of other searches through the .chm and nothing comes up. Perhaps you can revise my search term so that it does come up?

Link to comment
Share on other sites

It seems strange that nothing comes up. I have tried the terms wildcard and wildcards and I always get some results in every AU3 help file I have access to when I click the button List Topics. So I don't know what you are doing wrong.

The first result I get is _FileListToArray

Edited by czardas
Link to comment
Share on other sites

  • Moderators

graydwarf,

Searching the Help file for "wildcards" brings up 7 references - the second of which (FileFindFirstFile) states this:

"Wildcards: In general, * denotes zero or more characters, and ? denotes zero or one character. If your file search string contains only wildcards (or is "*.*"), then see the example below for the return value!

You can use only one wildcard in the filename part or in the extension part i.e. a*.b?.

?? seems equivalent to * (not described in Microsoft documentation).

When using a 3-char extension any extension starting with those 3 chars will match, .e.g. "*.log" will match "test.log_1". (not described either in Microsoft documentation)."

Us old(er) members remember all that from DOS days - seems like a lifetime ago. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Searching the Help file for "wildcards" brings up 7 references - the second of which (FileFindFirstFile) states this:

Ah, thanks. I saw that but I didn't think it was the "official" WildCards documentation since it's just one of many functions that could use WildCards. Seems odd to have it buried in just one of the many function definitions doesn't it?

Link to comment
Share on other sites

The help file is geared more towards specifics of the AutoIt language, and less towards general computing terminology. Certain terms which have general use are sometimes defined, but they do not warrent a separate page of their own in the help file, and it is really down to you to do further research for stuff like this. Otherwise the help file would become bloated.

Although it is not always reliable with every other subject, Wikipedia is one of the best resources for computing terminology, More advanced stuff is covered by MSDN and other coding websites. Realise that AutoIt interacts with Windows so many ways that it would be impossible to cover all possible related subjects in great detail.

Link to comment
Share on other sites

The help file is geared more towards specifics of the AutoIt language, and less towards general computing terminology. Certain terms which have general use are sometimes defined, but they do not warrent a separate page of their own in the help file, and it is really down to you to do further research for stuff like this. Otherwise the help file would become bloated.

Although it is not always reliable with every other subject, Wikipedia is one of the best resources for computing terminology, More advanced stuff is covered by MSDN and other coding websites. Realise that AutoIt interacts with Windows so many ways that it would be impossible to cover all possible related subjects in great detail.

I say all this lightly. Understanding this is just some little documentation issue, I don't think this sort of thing should turn into a "not our problem buddy" situation.

It's just my personal experience but wildcards and regular expression syntax tends to be language/platform/application dependent and while similar, almost never exact. Referencing other languages to determine how AutoIt might work seems like a futile approach in this regard. Based on how I had to discover it, I just feel like it's in a really odd place (some arbitrary function) and could possibly (maybe) deserve a little more visibility. I also don't see how moving content to a more appropriate and discoverable location translates into "bloat". I also think that sending folks to google for WildCard syntax seems a little silly. I could totally understand if AutoIt referenced an external resource for a specific wildcard implementation and did so from a more discoverable page. That would make sense.

For the record, the first two google hits (didn't look at 3+) for WildCards are in fact on WikiPedia. However, neither has to do with programming. :) The point I'm trying to make is that it might be unproductive to send new or unknowing people off into the abyss for answers when the perfect answer is already sitting right under their finger tips (f1). ;)

Link to comment
Share on other sites

graydwarf,

Searching the Help file for "wildcards" brings up 7 references - the second of which (FileFindFirstFile) states this:

"Wildcards: In general, * denotes zero or more characters, and ? denotes zero or one character. If your file search string contains only wildcards (or is "*.*"), then see the example below for the return value!

You can use only one wildcard in the filename part or in the extension part i.e. a*.b?.

?? seems equivalent to * (not described in Microsoft documentation).

When using a 3-char extension any extension starting with those 3 chars will match, .e.g. "*.log" will match "test.log_1". (not described either in Microsoft documentation)."

Us old(er) members remember all that from DOS days - seems like a lifetime ago. :)

M23

I believe these two statements in the AutoIt help file :-

"You can use only one wildcard in the filename part or in the extension part i.e. a*.b?."; and,

"?? seems equivalent to * (....)."

under the FileFindFirstFile function are incorrect.

#include <File.au3>
#include <Array.au3>

Local $sDirectory = StringRegExpReplace(@AutoItExe, "^(.+\\)(.+)", "\1")

; This is wrong:-
; "You can use only one wildcard in the filename part or in the extension part i.e. a*.b?."
Local $Filter = "?u*n*.*" ; Uncomment this line to test
; Returns Au3Info.exe, and Au3Info_x64.exe

; This is wrong:-
; "?? seems equivalent to * (not described .....)."
;Local $Filter = "au3????.*" ; Uncomment this line to test
; Returns Au3Info.exe only. "Au3" followed by more than 4 characters before the file extension, is not captured.
; With $Filter = "au3??" no files are matched.

; This is correct:-
; "When using a 3-char extension any extension starting with those 3 chars will match, .e.g. "*.log" will match "test.log_1". (not described either in Microsoft documentation)."
; Also with $Filter = "*.l??", all files with any length file extension, beginning with "l", will be captured.

Local $FileList = _FileListToArray($sDirectory, $Filter, 1); Files only
If @error = 1 Then
    MsgBox(0, "", "No Folders Found.")
    Exit
EndIf
If @error = 4 Then
    MsgBox(0, "", "No Files Found.")
    Exit
EndIf
_ArrayDisplay($FileList, "$FileList")
Edited by Malkey
Link to comment
Share on other sites

I believe these two statements in the AutoIt help file :-

"You can use only one wildcard in the filename part or in the extension part i.e. a*.b?."; and,

"?? seems equivalent to * (....)."

under the FileFindFirstFile function are incorrect.

I made note of this in the Help File thread in Developer Chat about the second line concerning "??" recently, because that doesn't work in the 3 versions of Windows I've tried it on (XP, Vista, and 7). ?? equals any 2 characters or less in a filename, not an unlimited number of characters.

I'm not sure what the help file is saying about the first line, because you can mix them, it just makes no sense to do so.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

There is clearly some confusion regarding wildcards, and I think graydwarf has raised some valid points. I don't always rely on things working the way one would expect, and it is fortunate that there are often ways to get around the problems. I would personally employ regexp to handle using wildcards for certain types of search. I have never had any problems using wildcards the way they are implemented in AutoIt, but I have yet to use multiple wild cards. It is something for the near future and I'll be relying on regexp as stated.

Link to comment
Share on other sites

Unfortunately, the functions that would use wildcards can't use RegEx in their place, you would have to use RegEx after the fact to filter out what you do/don't want in your file searches. Knowing how the wildcards work would make that easier, unfortunately again, the help file is wrong about them in most examples.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Wildcards are treacherous at best when you are working with Windows.

There is a Unix wildcard "~" (tilde) that is not supposed to work in Windows and in fact doesn't from XP up but it certainly did in W98SE. That was discovered the hard way when MS screwed up in OE6 and it was generating a file that was simply named "~" with no extension. Typing "~" into the search field returned every file (no folders) on the computer except what you were looking for.

I think it was around that point when I started mis-trusting everything on the web about wildcards in general.

EDIT:

That is the primary reason I wouldn't worry about changing the docs too much. No matter what is stated it's bound to be either wrong or incomplete at the very best.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

BrewMaNH - Okay this is something different. In my case I am refering to a custom text search engine. It will be pretty easy to implement multiple wildcards, since I'll be building it from the ground up. In my case it's not really related to file search.

I agree with you GEOSoft.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...