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.aygfsteel.com/zhyiwww   
          |----------------------------------------------------------------------------------------|
          posted on 2009-02-24 14:01 zhyiwww 閱讀(497) 評論(0)  編輯  收藏 所屬分類: linuxwindowsdebian
          主站蜘蛛池模板: 固始县| 湟中县| 绍兴市| 永修县| 明溪县| 大港区| 双城市| 深州市| 七台河市| 长泰县| 沁阳市| 三明市| 射阳县| 开鲁县| 营山县| 崇阳县| 集安市| 乌兰县| 汉寿县| 双鸭山市| 广河县| 秭归县| 涿鹿县| 十堰市| 铁岭市| 会昌县| 伊吾县| 启东市| 吉首市| 宕昌县| 广丰县| 若尔盖县| 林西县| 崇义县| 泰安市| 汽车| 伊宁市| 汉源县| 耒阳市| 阳春市| 石渠县|