代码: 全选
#noticep{ margin:0 10px; width:660px; background:url(http://mobile.qq.com:8080/web_mobile/mobile_res/mobile2009/images/double_line.gif) repeat-x bottom; padding-bottom:20px; }
另外,在sed grep awk 里有环视的吗
代码: 全选
#noticep{ margin:0 10px; width:660px; background:url(http://mobile.qq.com:8080/web_mobile/mobile_res/mobile2009/images/double_line.gif) repeat-x bottom; padding-bottom:20px; }
代码: 全选
echo "#noticep{ margin:0 10px; width:660px; background:url(http://mobile.qq.com:8080/web_mobile/mobile_res/mobile2009/images/double_line.gif) repeat-x bottom; padding-bottom:20px; }" |sed -r "s|.+(http://[A-Za-z0-9_./:]+).+|\1|g"
HuntXu, 你写的sed我有点不太懂,可以帮我解释下吗。sed -r "s|.+(http://[A-Za-z0-9_./:]+).+|\1|g"
代码: 全选
echo "#noticep{ margin:0 10px; width:660px; background:url(http://mobile.qq.com:8080/web_mobile/mobile_res/mobile2009/images/double_line.gif) repeat-x bottom; padding-bottom:20px;}"|awk -F'[()]' '{print $2}'
代码: 全选
grep -o "http://[^)]*"
原来grep还有o这个选项,受教了,thanksaerofox 写了:代码: 全选
grep -o "http://[^)]*"