Regular expressions are primarily a grammar rule used to describe character permutations and matching patterns. It is mainly used for the pattern segmentation, matching, finding and substitution of strings, the main purpose is to match.
Wildcard characters:
*-Match any Content
? -Match any one character
[]-matches the contents in parentheses
A regular expression is used to match a string in a file that matches a condition, and is to contain a match .
Wildcards are used to match the qualified file names, which are exact matches .
grep, awk, sed, and other commands can support regular expressions.
Commands such as LS, find, and CP do not support regular expressions, so they can only be matched using the shell's own wildcard character.
The general matching form is listed as follows:
* |
previous character matches 0 or more times |
. |
match any character except newline characters |
^ |
Match header |
$ |
matches end of line |
[] |
matches any one of the characters in the brackets, which can be listed as long as one character is satisfied |
[^] |
matches any character except for the brackets |
\ |
escape character |
\{n\} |
indicates that the characters that precede them appear exactly n times, preferably preceded or preceded by a qualifying character, which makes it difficult to match exactly. |
\{n,\} |
indicates that the preceding characters appear no less than n times, in fact the last match is almost the same as this |
\{n,m\} |
indicates that the characters preceding it appear not less than n times, not more than m times. |
  |
|
Regular expression in the beginning of a language will be more trouble, so more hands-on operation to better familiar.
The regular expression of shell programming