From: shaobo.li@...
Date: 2005-01-11T18:21:19+09:00
Subject: cannot I search the doc's contents (doc=file.read) one more times?
Hi,
I wanna retrive ip and its port from the html file which contains
"
| 61.135.158.111 |
80 | ",cannot I search the doc's contents (doc=file.read) one
more times?
doc=file.read
#first get ip'es success
ips=doc.scan(/(\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3})/)
ips.each {|ip| puts ip }
#then get ports still on doc ,but no one got nothing,if commentted
above ip scans ,this would works.
ports=doc.scan(/(\d+)<\/td>/)
ports.each {|port| puts port }
file.close
Thanks in advance!
|