05_01_egrep and extended Regular expressions
Regular expressions are divided into two categories:
Basic REGEXP: base Regular Expression
Extended REGXP: extending regular Expressions
grep: A command to filter text using a template defined by a basic regular expression
- e: using extended regular expressions, grep-e = Egrep
- A number: When grep matches, the next number of rows ( the number of rows is the number after a) is immediately displayed.
- b numbers: ..... ..... Front..............
- c number: ..... ..... Before and after ......
An extended regular expression:
Character Matching:
Same as the basic regular expression
. Single character
[] in-range characters
[^] out of range characters
Number of matches:
*: The first 0 or any time. Is the same as the basic regular expression.
? : the first 0 or 1 times. The basic regular expression needs to be preceded by the addition of \, the extension does not need to add.
+: Match its first character at least once
{M,n} does not require \:
Positional anchoring is the same as the basic regular expression.
Group:
(): Group, do not need \
\1,\2,\3 ...
Or
|: Indicates or a|b represents a or B ... c|cat: denotes C or cat, (C|C) at: Indicates cat or cat
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/72/6E/wKioL1Xj8YyBuPbyAABPMQanKko108.jpg "title=" 3cbb4811-3cf7-400b-afa0-da97fb38e1be.jpg "alt=" Wkiol1xj8yybupbyaabpmqankko108.jpg "/>
The number of 1-9, or 10-99, or 100-199, or 200-249, or 250-255.
Fgrep: Regular expressions are not supported, but fast
This article is from the "It_landscape" blog, make sure to keep this source http://huangyisan.blog.51cto.com/6925110/1690110
Linux_egrep and extended Regular expressions