Moderators Melba23 Posted May 23, 2010 Moderators Share Posted May 23, 2010 Spiff59, Got you now - thanks. Looking into your SREs to see how you build up the masks - why must the damned things be so difficult? 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 Link to comment Share on other sites More sharing options...
Spiff59 Posted May 23, 2010 Share Posted May 23, 2010 Still does screwy things with multiple parameters in the list: $IncludeList = "A*;$*.*" returns "~$Normal.dot" $IncludeList = "A*;$.*" returns "$winnt$.inf" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 23, 2010 Moderators Share Posted May 23, 2010 Spiff59, I just use simple alphanumerics as filenames - why do people have to make it so complicated by using all these other characters? This seems to fix it: $s##clude_List_Mask = "(?i)^(" & StringReplace(StringReplace(StringRegExpReplace($s##clude_List, "(\^|\$|\.)", "\\$1"), "*", ".*"), "?", ".") & ")\z" ; Convert to SRE pattern Oh how I love SREs! M23 P.S. Actually, despite my moaning, I am very grateful for the input - always something to improve in any code (especially mine!). 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 Link to comment Share on other sites More sharing options...
Spiff59 Posted May 23, 2010 Share Posted May 23, 2010 (edited) Spiff59, I just use simple alphanumerics as filenames - why do people have to make it so complicated by using all these other characters? This seems to fix it: $s##clude_List_Mask = "(?i)^(" & StringReplace(StringReplace(StringRegExpReplace($s##clude_List, "(\^|\$|\.)", "\\$1"), "*", ".*"), "?", ".") & ")\z" ; Convert to SRE pattern Oh how I love SREs! M23 P.S. Actually, despite my moaning, I am very grateful for the input - always something to improve in any code (especially mine!). I still like the one from a year ago It is very very similar, and has the ExcludeFolder parameter which can be useful (as in darkjohn20's last post) It also seems to be considerably faster in most cases. Edited June 22, 2010 by Spiff59 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 24, 2010 Moderators Share Posted May 24, 2010 darkjohn20,My final (at least for the moment! ) suggestion:$s##clude_List_Mask = "(?i)^(" & StringReplace(StringReplace(StringRegExpReplace($s##clude_List, "(\^|\$|\.)", "\\$1"), "?", "."), "*", ".*?") & ")\z" ; Convert to SRE patternThis gives me the same results as Spiff59's SREs - so it must be pretty good! If you are interested, the 2 patterns come out like this (using "*.exe;*.dll*" as a filter):Spiff59: (?i)\A(?!.*?[.]exe$|.*?[.]dll.*?$) Melba23: (?i)^(.*?\.exe|.*?\.dll.*?)\zThey are basically identical:(?i) - case insensitive\A or ^ - start at beginning of string(something|something_else) - use either|or (if you have multiple filters).*?[.]exe or .*?\.exe - smallest match of any number of characters followed by .exe.*?[.]dll.*? or .*?\.dll.*? - smallest match of any number of characters followed by .dll followed by smallest match of any number of characters $ or \z - end of string (either at end of each option or at the end of the option ()Where we differ is the use of ?! (a zero-width negative lookahead) at the start of the () section - and there I cannot help because, although I know what it is, I have no idea why it is there! ; -----Anyway, I seem to have been ignoring your original request since we got involved in the SRE discussions - my apologies. The dratted things have a sort of morbid fascination which draws you in ever further..... Are you happy with the code now or are there things we could improve? Or would you prefer to use Spiff59's code instead? Please let me know. 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 Link to comment Share on other sites More sharing options...
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