Shell文本处理 (3) grep 正则表达式
2015-02-19 18:14
281 查看
grep 't[ae]st' myTxt // 查找 tast 或test
grep '[^g]oo' myTxt // 查找含有oo,但前面没有g
grep '[^a-zA-Z]oo' myTxt // 查找含有oo,但前面没有字母
grep '^the' myTxt // 查找the开头
grep '^[a-z]' myTxt // 查找小写字母开头
grep '^[^a-z]' myTxt // 查找不是小写字母开头
grep '[a-z]$' myTxt // 查找小写字母结尾
grep '\.$'' myTxt // 查找.结尾
grep '^S' //查找空白行
---------------------------------------------
待续
grep '[^g]oo' myTxt // 查找含有oo,但前面没有g
grep '[^a-zA-Z]oo' myTxt // 查找含有oo,但前面没有字母
grep '^the' myTxt // 查找the开头
grep '^[a-z]' myTxt // 查找小写字母开头
grep '^[^a-z]' myTxt // 查找不是小写字母开头
grep '[a-z]$' myTxt // 查找小写字母结尾
grep '\.$'' myTxt // 查找.结尾
grep '^S' //查找空白行
---------------------------------------------
待续
相关文章推荐
- Shell文本处理三剑客之grep
- 几个常用的文本处理shell 命令:find、grep、xargs、sort、uniq、tr、cut、paste、wc、sed、awk
- shell脚本之正则表达和文本处理(文本处理三剑客:1、grep 2、sed 3、awk)
- Shell文本处理三剑客之grep
- 01-shell文本处理三剑客之grep
- 第七章 Shell文本处理三剑客之grep
- shell 文本处理三剑客之grep
- 第七章 Shell文本处理三剑客之grep
- 几个常用的文本处理shell 命令:find、grep、sort、uniq、sed、awk
- 正则表达式与文本处理三剑客之一:grep和egrep
- 文本处理之sed,awk,grep
- shell 处理文本小技巧
- shell 文本处理
- shell之文本过滤(grep)
- shell删除文本技巧 —— grep, cut, head, sed, awk
- shell文本处理1
- 一起学Shell之(四)文本处理以及管道
- 正则表达式及文本查找工具grep
- Shell脚本学习指南之文本处理工具
- [RedHat笔记]第三课:变量的种类及用法,alias命令,环境变量的分类和修改,输入输出重定向,for循环,文本处理类命令,grep命令,短路操作(&& ||)