gcue Posted May 26, 2020 Author Posted May 26, 2020 thank you UEZ! that was pretty comprehensive and included every example i ran by it. this was the only path i came across where it didn't work C:\ProgramData\bomgar-scc-cb\rs.company.com\embedhook-x86.exe --start rs.company.com --all-users its good enough though thanks again!
mikell Posted May 26, 2020 Posted May 26, 2020 Strangely the one I wrote after UEZ' comment works ... Local $a = "C:\ProgramData\bomgar-scc-cb\rs.company.com\embedhook-x86.exe --start rs.company.com --all-users" $path = StringRegExpReplace($a, '.*(\S+:\\.+?)(?=\s[/-]+\w+(?:\s|$)|$).*', "$1") $detail = StringRegExp($path, '^(.+)\\(.+)$', 3) Msgbox(0,"", $path &@crlf& $detail[0] &@crlf& $detail[1])
UEZ Posted May 26, 2020 Posted May 26, 2020 (edited) 53 minutes ago, gcue said: thank you UEZ! that was pretty comprehensive and included every example i ran by it. this was the only path i came across where it didn't work C:\ProgramData\bomgar-scc-cb\rs.company.com\embedhook-x86.exe --start rs.company.com --all-users its good enough though thanks again! If you know the file extensions you can use $sPath = StringRegExp($sCmd, ".*\b([\w]\:.+\.[exe|msi|zip|cmd|bat]+)\b\s*", 3)[0] but this is a lame solution. mikell is the regex guru Edited May 26, 2020 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
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