hamohd70 Posted May 5, 2016 Posted May 5, 2016 how can I use the StringRegEx function to extract certain lines of text from google search results in the following format: C: server port user password an example is this: C: starteam.myftp.org 18000 test1 text2 regards
InunoTaishou Posted May 5, 2016 Posted May 5, 2016 #include <String.au3> #include <Array.au3> Global $sString = "C: starteam.myftp.org 18000 test1 text2" Global $aSplit = StringSplit($sString, " ", $STR_NOCOUNT) Global $aDisplay[0][0] If (UBound($aSplit) = 5) Then ; This is just to make the _ArrayDisplay look good ReDim $aDisplay[UBound($aSplit)][2] $aDisplay[0][1] = $aSplit[0] $aDisplay[1][1] = $aSplit[1] $aDisplay[1][0] = "Server = " $aDisplay[2][1] = $aSplit[2] $aDisplay[2][0] = "Port = " $aDisplay[3][1] = $aSplit[3] $aDisplay[3][0] = "User = " $aDisplay[4][1] = $aSplit[4] $aDisplay[4][0] = "Password = " _ArrayDisplay($aDisplay) EndIf
hamohd70 Posted May 5, 2016 Author Posted May 5, 2016 3 hours ago, InunoTaishou said: #include <String.au3> #include <Array.au3> Global $sString = "C: starteam.myftp.org 18000 test1 text2" Global $aSplit = StringSplit($sString, " ", $STR_NOCOUNT) Global $aDisplay[0][0] If (UBound($aSplit) = 5) Then ; This is just to make the _ArrayDisplay look good ReDim $aDisplay[UBound($aSplit)][2] $aDisplay[0][1] = $aSplit[0] $aDisplay[1][1] = $aSplit[1] $aDisplay[1][0] = "Server = " $aDisplay[2][1] = $aSplit[2] $aDisplay[2][0] = "Port = " $aDisplay[3][1] = $aSplit[3] $aDisplay[3][0] = "User = " $aDisplay[4][1] = $aSplit[4] $aDisplay[4][0] = "Password = " _ArrayDisplay($aDisplay) EndIf Thanks.. this is fine. but I' looking for a way to run and parse google search results for the full line in this format C: starteam.myftp.org 18000 test1 text2 regards
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