第四章:高效文本处理

1、IP地址的正则表达式: [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}

2、grep用法

//在多级目录中对文本进行递归检索[root@localhost program_test]# grep "yang" ./ -Rn./test.txt:6:laoyang./right.txt:1:1 yang man//忽略大小写匹配[root@localhost program_test]# echo hello world | grep -i "HELLO"hello world//递归搜索所有.c和.cpp文件[root@localhost program_test]# grep "main()" . -r --include *.{c,cpp}./hel

收藏 打印