正则表达式(regular expression)

2016-11-05  本文已影响0人  wildsre

正则表示法 (regular expression)

用从文件中查找特定字符串的一种表示方法,与通配符不同,按行处理

不同编码方式会影响正则查找的结果

符号说明

基础正则表示练习

使用grep工具,在test文件中查找

延伸正则表示

正则表达式-symbol-expand.png

实用工具

sed: 取代、刪除、新增、擷取(整行处理)

printf: 格式化输出 printf 'format' 'content'
awk: 将一行的内容分成数个栏位,根据分隔符,条件来处理

档案比对工具:diff cmp patch

test
"Open Source" is a good mechanism to develop programs.
apple is my favorite food.
Football game is not use feet only.
this dress doesn't fit me.
However, this dress is about $ 3183 dollars.^M
GNU is free air not free beer.^M
Her hair is very beauty.^M
I can't finish the test.^M

Oh! The soup taste good.^M
motorcycle is cheap than car.
This window is clear.
the symbol '*' is represented as start.
Oh! My god!
The gd software is a library for drafting programs.^M
You are the best is mean you are the no. 1.
The world <Happy> is the same with "glad".
I like dog.
google is the best tools for search keyword.
goooooogle yes!
go! go! Let's go.
# I am VBird

上一篇 下一篇

猜你喜欢

热点阅读