FrancescoDiMuro Posted August 6, 2019 Posted August 6, 2019 2 hours ago, Nine said: Edit : if you find a general RE solution, I would love to see it There is no general RE solution. We are talking about filters, so every pattern must be build based on what has to be excluded or included, isn't it? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Nine Posted August 6, 2019 Posted August 6, 2019 7 minutes ago, FrancescoDiMuro said: We are talking about filters, so every pattern must be build based on what has to be excluded or included, isn't it? I think it is doable to have a general RE. There is only 2 wild cards ? and *. I believe someone agile with RE could make a first pass to replace DOS filter into a RE pattern then use it in a StringRexExp like you did...But that someone is not me “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Moderators Melba23 Posted August 6, 2019 Author Moderators Posted August 6, 2019 Hi, Thanks for the replies, but using a RegEx on all the returns is exactly what I am trying to avoid. As I explained to mikell earlier, if you look inside _RecFileListToArray you will see that the function changes the DOS wildcard inclusion/exclusion lists into SRE format within the following function: Func __FLTAR_ListToMask(ByRef $sMask, $sList) ; Check for invalid characters within list If StringRegExp($sList, "\\|/|:|\<|\>|\|") Then Return 0 ; Strip WS and insert | for ; $sList = StringReplace(StringStripWS(StringRegExpReplace($sList, "\s*;\s*", ";"), BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)), ";", "|") ; Convert to SRE pattern $sList = StringReplace(StringReplace(StringRegExpReplace($sList, "[][$^.{}()+\-]", "\\$0"), "?", "."), "*", ".*?") ; Add prefix and suffix $sMask = "(?i)^(" & $sList & ")\z" Return 1 EndFunc ;==>__FLTAR_ListToMask And then each returned element is checked to see if it should be listed with lines such as this one: If $iReturn <> 2 And StringRegExp($sName, $sInclude_File_Mask) And Not StringRegExp($sName, $sExclude_File_Mask) Then This works perfectly, but it means using AutoIt code to loop through each item and run more than one SRE on it to check if it a valid item - which is not fast! As I explained in the first post I am trying to bypass this bottleneck in execution speed and get Windows to do all the work for me. Hence my initial wish to have multiple include filters - the solution to which caused everyone (including me) so much amusement. Now I am hoping there is some way to get Windows to exclude files when using .Filter on the item list - but I have found nothing when Googling and was hoping that someone here already had an answer. So many thanks for your efforts so far but they really do nothing more than my existing code in _RecFileListToArray - what I want is an internal Windows filter so that all I see is the already filtered list within .Items. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Nine Posted August 7, 2019 Posted August 7, 2019 @Melba23 and all. You may (must ?) want to take a look at this information. It won't help you for the exclude but you gonna be surprised (at least I was very surprised)... https://blogs.msdn.microsoft.com/jeremykuhne/2017/06/04/wildcards-in-windows/ I tested on command line and it truly works. I will look into it using API.... Enjoy ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now