moosjuice Posted June 15, 2019 Share Posted June 15, 2019 Actually use ((.*)(?=\\)(\\))(stripped_v)(.*)(.au3)$ That \N was a holdover from the tutorial I was reading, which meant to match any single character when I alrady had .* doing everything in between. Also, (.*) is greedier, which is good to use when there is no chance of spillover into another part of the string. I will update my program and save some cycles 😇. Link to comment Share on other sites More sharing options...
youtuber Posted June 16, 2019 Author Share Posted June 16, 2019 (edited) I really want to solve this. I want to get the name of both exe files. jre-8u201-windows-i586.exe jre-8u201-windows-x64.exe jre-(?:\d+-u\d+)-windows-|.*(?:[i])\d+\.exe ;x86 jre-(?:\d+-u\d+)-windows-|.*(?:[x64])\d+\.exe ;x64 #include <file.au3> $pathjava = @ScriptDir $Fileversionjava = "jre-*.exe" $Searchjava = _FileListToArrayRec($pathjava, $Fileversionjava) If IsArray($Searchjava) Then _ArrayDisplay($Searchjava) For $j = 0 To UBound($Searchjava) - 1 If @OSArch = "X86" Then $RegExpjavax86 = StringRegExp($Searchjava[$j], 'jre-(?:\d+-u\d+)-windows-|.*(?:[i])\d+\.exe', 3) If IsArray($RegExpjavax86) Then ConsoleWrite($RegExpjavax86[0] & @CRLF) ;ShellExecuteWait(@ScriptDir & "\" & $RegExpjavax86[0], "/s") EndIf Else $RegExpjavax64 = StringRegExp($Searchjava[$j], 'jre-(?:\d+-u\d+)-windows-|.*(?:[x64])\d+\.exe', 3) If IsArray($RegExpjavax64) Then ConsoleWrite($RegExpjavax64[0] & @CRLF) ;ShellExecuteWait(@ScriptDir & "\" & $RegExpjavax64[0], "/s") EndIf EndIf Next EndIf Edited June 16, 2019 by youtuber Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 16, 2019 Share Posted June 16, 2019 @youtuber The patterns are a little bit messy. Try to use something like these ones: '^jre\-.+i\d{3}\.exe$' ; x86 '^jre\-.+x64.exe$' ; x64 youtuber 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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