學習正則表達式筆記

IP ([0-9]+(/.[0-9]+){3})

^cat$  完全匹配
^$    空行
[]    匹配列表
[^]   不在列表
.     匹配任意字符  如果要匹配點 /.

egrep 開始操作前strip end-of-line character(s)

/<  equal to ^
/>  equal to $

? 可選項   如 4(th)?  ====> (4th|4)
{n} 重複n次  {n,m} 重複n到m次 最多m


/t tab
/n 換行
/r  回車
/s  whitespace (space, tab, newline, formfeed,)
/S  not /s
/w  [a-zA-Z0-9_]
/W  not /w
/d   [0-9]
/D   not /d

perl -p -i -e 's/sysread/read/g' file
         ignorecase  regexp  

egrep  ==> grep -E

locate  -r  regexp

 

發佈了32 篇原創文章 · 獲贊 0 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章