1. Regular and wildcard characters
The wildcard characters in Linux are used to match the file names, and their matches are exact matches. Only wildcard characters are supported, command has LS find CP and other commands
The regular is used to match the string, and is to contain the match. As long as the search is in a string, the string is considered eligible, and the supported commands are grep awk sed.
2. Rules
Blank line matching, let's first look at the text file with blank lines what is it like?
As you can see, when we finish writing a line that belongs to carriage return, we are actually using $ as the end sign. So the end of a match in a regular expression with a line ending in xx (eg:. html$) is the result. The third line in the figure is made up of multiple spaces. So how do we get rid of the blank lines in the text?
Note that the ^ here has two meanings: the beginning, and also the non.
You can see that when you match "^$", only the second line is displayed, which represents the line beginning with $. When "[^$]" is matched, only the second line is not displayed. If the ^ is simply understood to be non-time, then the match does not have a $ row, the result should not be displayed. Therefore the ^ here should have also with $ for the beginning meaning.
Regular expressions in the shell