Grep does not support regular expression matching.
Egrep supports regular expression matching, but the extension does not.
Find Vim /? : Regular Expression matching is supported, but not extended.
Common examples:
Grep XXX 123.logBasic grep
Egrep name = 123. * Port = 80 search for rows containing name = 123 and Port = 80
VIM:/name = 123. * Port = 80 search for rows containing name = 123 and Port = 80
Vim can be used with other operations to complete some functions:
G/^ $/d find and delete empty rows
G/name = 123. * Port = 80/d find and delete rows containing name = 123 and Port = 80
Regular Expression to quickly adjust grep
Regular Expression: It is composed of a bunch of metacharacters. These metacharacters are combined according to certain rules to filter and match different contents. (In short, a regular expression is a filter composed of metacharacters)
Regular Expression Classification
1. Basic Regular Expression: a standard regular expression that supports basic metacharacters.
The metacharacters supported by the basic regular expression have the following meanings:
2. Extended Regular Expressions: More metacharacters are supported than the basic regular expressions, but the extended regular expressions do not support metacharacters supported by some basic regular expressions.
Extended Regular Expressions support metacharacters:
Through comparison, we will find that the metacharacters supported in basic regular expressions are not all supported in extended regular expressions.
Source: <understand grep and regular expressions-Linux->