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 閱讀(498) 評論(0)  編輯  收藏 所屬分類: linuxwindowsdebian
          主站蜘蛛池模板: 德钦县| 望城县| 汤阴县| 神池县| 大冶市| 郑州市| 临高县| 京山县| 禹城市| 依安县| 沙田区| 越西县| 德清县| 朝阳市| 师宗县| 江山市| 乐昌市| 冀州市| 卫辉市| 榆林市| 顺平县| 化德县| 巧家县| 额敏县| 文安县| 平陆县| 金华市| 四子王旗| 蓝田县| 元谋县| 惠州市| 崇阳县| 临朐县| 嘉荫县| 宁河县| 贡嘎县| 黄浦区| 油尖旺区| 济阳县| 宁安市| 湟中县|