Extending regular Expressions
Extended Regular Expression command: Egrep
Regular expressions are not supported but fast: fgrep
Character Matching:
.:
[]:
[^]:
Number of matches:
*:
?:
+: Match the characters in front of it at least once
{m}: Exact match
{M,n} no backslash required:
Location anchoring:
^:
$:
\< or \b:
\> or \b:
Group:
(): Group
\1,\2,\3,......
Or
|: or (A|B)
Cases:
C|cat=c or Cat
(c|c) At=cat or cat
Lazy Qualifier
*? Repeat any number of times, but repeat as little as possible
+? Repeat 1 or more times, but repeat as little as possible
?? Repeat 0 or 1 times, but repeat as little as possible
{n,m}? Repeat N to M times, but repeat as little as possible
{N,}? Repeat more than n times, but repeat as little as possible
This article is from the "rime" blog, please be sure to keep this source http://kinrey.blog.51cto.com/10492082/1770406
Linux Common Command-egrep and extended regular expressions