mikell Posted September 20, 2015 Share Posted September 20, 2015 Why not simply$sExclude = "Microsoft V|Security U|CCC" For $removeloop = UBound($aList)-1 To 1 step -1 If StringRegExp($aList[$removeloop][2], $sExclude) Then ; If found... _ArrayDelete($aList, $removeloop) ; ...then remove it EndIf Next Link to comment Share on other sites More sharing options...
Chimaera Posted September 20, 2015 Author Share Posted September 20, 2015 aah so i did do it correctlyok ill go check the rest thx If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
jguinch Posted September 20, 2015 Share Posted September 20, 2015 @Chimaera : for me, it's not necessary to use a loop to remove result, considering that a regex can do the job directly (see #19). Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
czardas Posted September 20, 2015 Share Posted September 20, 2015 (edited) @jguinch I haven't actually tested your function, but I took a look. I hope Chimaera will figure it out using your inbuilt and ready-made solution. I think it is also important (for the exercise) to get used to looping through a multi-dimensional array and knowing the correct syntax to use. I'm happy to see Chimaera was able to figure that out himself. Edited September 20, 2015 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
mikell Posted September 20, 2015 Share Posted September 20, 2015 @Chimaera : for me, it's not necessary to use a loop to remove result, considering that a regex can do the job directly (see #19).Right, but the proper pattern to use as filter in your func is not so easy to buildA simple string with keywords and delimiters is much more easy and intuitiveBTW the use of such a filter feature could be a nice add to your func Link to comment Share on other sites More sharing options...
Chimaera Posted September 21, 2015 Author Share Posted September 21, 2015 I ended up with this$aList = _UninstallList("DisplayName", "(?i)^(?!Update for Micr)(?!Security Update for Micr)(?!Microsoft)(?!Windows Live)(?!Office)(?!NVIDIA)(?!Nero)(?!CCC)(?!Adobe)", "UninstallString", 3, 3)One question with the regex are these 2 the same?(?!Update for Micr)(?!Security Update for Micr) If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
mikell Posted September 21, 2015 Share Posted September 21, 2015 (edited) ^(?!text) = beginning of the string non followed by "text" (meaning : "text" doesn't stand at the beginning of the string) , thus the regex are not the same$s = "abcd" If stringregexp($s, '^(?!b)') Then msgbox(0,"", "the string doesn't begin with b") If not stringregexp($s, '^(?!a)') Then msgbox(0,"", "the string begins with a")EditYou could build the pattern from a string like this$sExclude = "Update for Micr|Security Update for Micr|Microsoft|Windows Live|Office|NVIDIA|Nero" $pattern = "(?i)^(?!" & $sExclude & ")" Msgbox(0,"", $pattern) Edited September 21, 2015 by mikell 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