正则语法===元字符串word 匹配指定字符串(word)的值
^word 匹配以指定字符串开头的值 grep -n ';^#'; test.txt
word$ 匹配以指定字符串结尾的值 grep -n ';!$'; test.txt
[abc] 匹配中括号中的任意一个字符,它们之间是或者关系 grep -n ';g[ld]'; test.txt
[^list] 匹配不在中括号中指定的任意字符 grep -n ';oo[^t]'; test.txt
[n1-n2] 匹配列出的选取范围!grep -n ';[A-Z]'; test.txt grep -n ';[A-Za-z0-9_]'; test.txt
. 匹配任意一个字符 grep -n ';e.e'; test.txt
\; 转义字符,将特殊符号的特殊意义去除 grep –n ';\;.'; test.txt
x|y 管道,表示或者关系 egrep ';ab|bc';
() 表示字符串分组 egrep ';^a(b|c)$';
\;d 匹配数字grep -P
\;w 匹配字母数字下划线grep -P
\;s 匹配空格、制表符、换页符 grep -P