cypher175 Posted November 1, 2009 Posted November 1, 2009 How could I parse this webpage http://proxy-heaven.blogspot.com for proxies..?? I know how to get the webpage source code, I just don't really know of any great way to parse the source data for "IP:Port" is there some kinda function or something that can collect a string if it matches something like "XXX.XXX.XXX.XXX:XXXXX" where the "X" stands for a wild card for any number between 0-9....?? Anybody have any good ideas on how to go about doing something like this..??
cypher175 Posted November 2, 2009 Author Posted November 2, 2009 anybody have any tips on how i could go about doing this..??
Bert Posted November 2, 2009 Posted November 2, 2009 Perhaps... InetGet ( "URL" [,"filename" [, reload [, background]]] ) The Vollatran project My blog: http://www.vollysinterestingshit.com/
Authenticity Posted November 2, 2009 Posted November 2, 2009 (edited) #include <Array.au3> Local $sText = "0ke30ke :oo: 123.123.123.1234:4-4l-4 30.90.60.90:12234" Local $avMatches = StringRegExp($sText, "((?>(?:[01]?\d?\d|25[0-5]|2[0-4]\d)\.){3}(?:[01]?\d?\d|25[0-5]|2[0-4]\d)):(\d{1,5})", 3) If IsArray($avMatches) Then _ArrayDisplay($avMatches)Edit: Meh... Edited November 2, 2009 by Authenticity
cypher175 Posted November 3, 2009 Author Posted November 3, 2009 #include <Array.au3> Local $sText = "0ke30ke :oo: 123.123.123.1234:4-4l-4 30.90.60.90:12234" Local $avMatches = StringRegExp($sText, "((?>(?:[01]?\d?\d|25[0-5]|2[0-4]\d)\.){3}(?:[01]?\d?\d|25[0-5]|2[0-4]\d)):(\d{1,5})", 3) If IsArray($avMatches) Then _ArrayDisplay($avMatches) Edit: Meh... Thanks Authenticity, It seems to work good, but why does the port get put onto a diff array line..?? how can I extract the "IP:PORT" so its all on one array line like: 123.123.123.123:1080 123.123.123.123:1080 123.123.123.123:1080 123.123.123.123:1080
Authenticity Posted November 3, 2009 Posted November 3, 2009 Because of capturing groups, remove them: StringRegExp($sText, "(?>(?:[01]?\d?\d|25[0-5]|2[0-4]\d)\.){3}(?:[01]?\d?\d|25[0-5]|2[0-4]\d):\d{1,5}", 3)
cypher175 Posted November 21, 2009 Author Posted November 21, 2009 thanks, it works great, so how would I use StringRegExp to extract MAC addresses from a .txt file in a similar way..?? 00:00:00:00:00:00 AA:AA:AA:AA:AA:AA 12:34:56:78:90:12 Ect.. Letters A-F Nums 0-9
Authenticity Posted November 21, 2009 Posted November 21, 2009 Local $sString = "AA:BB:10:20:1F:1F FF:ak:0i:ng: 11:11:11:oo:QQ:pp a:b:c:d:e:f:0" Local $avMatches = StringRegExp($sString, "\b(?:[[:xdigit:]]{1,2}:){5}(?:[[:xdigit:]]{1,2})\b", 3) If IsArray($avMatches) Then For $i = 0 To UBound($avMatches)-1 ConsoleWrite($avMatches[$i] & @CRLF) Next EndIf
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