grep中整字匹配
来源:互联网 发布:mac os x 启动盘 编辑:程序博客网 时间:2024/05/16 03:29
$ man grep
-G, --basic-regexp
Interpret PATTERN as a basic regular expression (BRE, see below). This is the default.
-P, --perl-regexp
Interpret PATTERN as a Perl regular expression. This is highly experimental and grep -P may
warn of unimplemented features.
Matching Control
-e PATTERN, --regexp=PATTERN
Use PATTERN as the pattern. This can be used to specify multiple search patterns, or to
protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.)
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. The empty file contains zero patterns, and
therefore matches nothing. (-f is specified by POSIX.)
-i, --ignore-case
Ignore case distinctions in both the PATTERN and the input files. (-i is specified by
POSIX.)
-v, --invert-match
Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the
matching substring must either be at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end of the line or followed by a
non-word constituent character. Word-constituent characters are letters, digits, and the
underscore.
-x, --line-regexp
Select only those matches that exactly match the whole line. (-x is specified by POSIX.)
-y Obsolete synonym for -i.
General Output Control
-G, --basic-regexp
Interpret PATTERN as a basic regular expression (BRE, see below). This is the default.
-P, --perl-regexp
Interpret PATTERN as a Perl regular expression. This is highly experimental and grep -P may
warn of unimplemented features.
Matching Control
-e PATTERN, --regexp=PATTERN
Use PATTERN as the pattern. This can be used to specify multiple search patterns, or to
protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.)
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. The empty file contains zero patterns, and
therefore matches nothing. (-f is specified by POSIX.)
-i, --ignore-case
Ignore case distinctions in both the PATTERN and the input files. (-i is specified by
POSIX.)
-v, --invert-match
Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the
matching substring must either be at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end of the line or followed by a
non-word constituent character. Word-constituent characters are letters, digits, and the
underscore.
-x, --line-regexp
Select only those matches that exactly match the whole line. (-x is specified by POSIX.)
-y Obsolete synonym for -i.
General Output Control
-c, --count
查看man手册可以看到:
-w选项就是整字匹配
下面还有个-x选项是整行匹配。
- grep中整字匹配
- grep/sed 匹配变量
- linux grep 匹配tab
- grep 精确匹配
- grep 如何匹配 Tab
- find / grep 匹配多项
- grep匹配到二进制文件
- grep精准匹配
- grep精确匹配
- 输出匹配项:grep
- 正则匹配 grep
- linux grep 匹配查找
- grep怎样匹配tab键
- grep同时两个匹配条件
- grep 多个关键字匹配
- grep的或,与匹配
- Linux grep匹配特殊字符
- grep 匹配的几个参数
- 生成模拟器和手机通用的库
- Android 漂浮的Activity
- 倒排索引-搜索引擎的基石
- Step By Step(C++模板类)
- DB2分区概念
- grep中整字匹配
- c语言笔记
- 一张图让你看懂JavaScript各类型的关系
- Step By Step(C++模板基本技巧)
- 关于android中出现"ADB server didn't ACK"这个问题解决方案
- Cache-Control max-age=0
- 统计描述与SAS过程
- java中使用队列:java.util.Queue
- Java Socket