正则习题讲解:
1.grep -n ‘the’ test.txt
2.grep -vn ‘the’ test.txt
3.grep -in ‘the’ test.txt
4.grep -n ‘the|taste’ test.txt
5.grep -n ‘00’ test.txt
6.grep -n ‘[^g]00’ test.txt
7.grep -n ‘[^a-z]00’tset.txt
grep -n ‘[^[:lower:]]00’
8.grep -n ‘[0-9]’test.txt
grep -n ‘[[:digit:]]’ test.txt
9.grep -n ‘^the’ test.txt
10.grep -n ‘^[a-z]’ test.txt
grep -n ‘^[:lower:]’ test.txt
11.grep -n ‘[a-zA-z]’ test.txt
12.grep -n ‘\.$’ test.txt
13.grep -n ‘^$’ test.txt
14.grep -n ‘g..d’ test.txt
15.grep -n ‘ooo*’ test.txt
16.grep -n ‘goo*g’ test.txt
17.grep -n ‘[0-9][0-9]*’ test.txt
18.grep -n ‘o\{2\}’ test.txt
19.grep -n ‘go\{2,5\}g’ test.txt
20.grep -n ‘o\{2,\}’ test.txt