zhyiwww
用平实的笔,记录编程路上的点点滴滴………
posts - 536,comments - 394,trackbacks - 0

[1]在windows下和linux使用上的不同点
windows下的用法
grep -ior -e img[0-9]\{2,\}
也可以是
grep -ior -e "img[0-9]\{2,5\}"

linux 下的用法
grep -ior -e "img[0-9]\{2,5\}"

在windows下和linux下的区别主要是 正则表达式 的引号

[2]多条件查询

and 关系
grep -ro -e "\/tour\/" * | grep -n  -e  "index"

[3]贪婪模式
比如:
grep -o  -e "href=\".*[0-9]\{3\}\"" *.html
返回的结果是
walking_beijing.html:href="/cts/tour/travelitinerary_357"
walking_beijing.html:href="/cts/tour/travelprice_357"
walking_beijing.html:href="/chinatravelguide/index.html"><img src="http://image.chinatraXXXXX.com/xianlu_013.jpg" width="430" height="125"

这个蓝色的匹配项不是我想要的

[4]






|----------------------------------------------------------------------------------------|
                           版权声明  版权所有 @zhyiwww
            引用请注明来源 http://www.blogjava.net/zhyiwww   
|----------------------------------------------------------------------------------------|
posted on 2009-02-24 14:01 zhyiwww 阅读(481) 评论(0)  编辑  收藏 所属分类: linuxwindowsdebian

只有注册用户登录后才能发表评论。


网站导航: