【发布时间】:2015-05-20 21:35:37
【问题描述】:
我有一个这样格式的横幅列表:
Hostname: []
IP: xxx.xxx.xxx.xxx
Port: xx
HTTP/1.0 301 Moved Permanently
Location: /login.html
Content-Type: text/html
Device-Access-Level: 255
Content-Length: 3066
Cache-Control: max-age=7200, must-revalidate
为了获取ip,我使用了下面的grep语句:
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
我必须在语句中添加什么才能获取端口? (同时仍然获得 IP。)。
感谢您的回答..!
【问题讨论】: