careca Posted July 10, 2014 Posted July 10, 2014 Hi, im struggling with this issue, StringInStr could do the trick, but it doesn't seem to support 3 different strings to compare, StringRegExp is messy, i tried some ways, help was no help, so i hope you can. So this will exemplify what i need: $StrDropCheckFolder = StringInStr($__aGUIDropFiles[$i], ".mp3;.wav;.wma", 2) Anything that contains those = true I made the StringRegExp work, but only with one string at a time. Couldn't find in help file the corresponding OR parameter.. and OR doesn't work in StringInStr. Best regards. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Danp2 Posted July 10, 2014 Posted July 10, 2014 Have you considered reversing the logic? IE: Get the extension of the file and use that to search against ".mp3;.wav;.wma". Latest Webdriver UDF Release Webdriver Wiki FAQs
czardas Posted July 10, 2014 Posted July 10, 2014 (edited) In StringRegExp, pipe is used for OR. ==> ".mp3|.wav|.wma" Edited July 10, 2014 by czardas careca 1 operator64 ArrayWorkshop
Solution jguinch Posted July 10, 2014 Solution Posted July 10, 2014 (edited) Something like this ? Local $aFiles[] = [ "1.mp3", "2.txt", "3.wav", "4.wma", "5.doc"] For $i = 0 To UBound($aFiles) - 1 If StringRegExp($aFiles[$i], "(?i)\.(?:wav|mp3|wma)$") Then ConsoleWrite($aFiles[$i] & @CRLF) Next Edited July 10, 2014 by jguinch careca 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
careca Posted July 10, 2014 Author Posted July 10, 2014 (edited) Hi, thank you all, it is exactly that, now i've been looking at the help file, and what "czardas" posted is what is called a "Non-capturing group with reset" yes? and what "jguinch" posted is a "Non-capturing group", have to be honest, i've seen them in the help file, but didn't have a clue it was what i was looking for. Also im trying to understand what is what, and i've used (?i) to make whats next to it case in-sensitive, but why is "." this used between it and the grouped items? About the $ at the end.. help file says: "Outside a character class, the dollar matches at the end of the subject text, and also just before a newline sequence if option (?m) is active." So, like a final dot in a sentence? Thanks EDIT: after looking at it again, it seems the trailing backlash represents whats before the dot, and the dot, represents the extension dot, and is where it is, because it is common to the text in the group. Edited July 10, 2014 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
mikell Posted July 10, 2014 Posted July 10, 2014 About the $ at the end of the pattern, just try this with and without the $ $str = "test.mp3.bak" Msgbox(0,"", StringRegExp($str, "(?i)\.(?:wav|mp3|wma)$") )
careca Posted July 10, 2014 Author Posted July 10, 2014 About the $ at the end of the pattern, just try this with and without the $ $str = "test.mp3.bak" Msgbox(0,"", StringRegExp($str, "(?i)\.(?:wav|mp3|wma)$") ) Yes, with it, it only searches the last bit, without it, searches all. Thank you Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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