Wildcard characters in Bash (wildcard)
*: Any character of any length.?: any single character []: Match range [^]: Exclude Match range [: alnum:] [: Alpha:] [: Blank:] [: cntrl:][:d Igit:] [: Graph:] [: Lower:] [:p rint:][ :p UNCT:] [: Space:] [: Upper:] [: xdigit:]
Regular expressions
.: Indicates matching any single character. *: Indicates that matches the preceding character any time, including 0 times. *: represents any character that matches any length.?: You may need to escape with a backslash to indicate that the preceding character appears 0 or 1 times. \?\{n,m\}: Matches the preceding character appears n to M times. \{n,\}: Matches the preceding character appears more than n times. \{n\}: Matches the preceding character appears n times. ^: Matches the beginning of the line, the content after this character must appear at the beginning of the row. $: Matches the end of the line, and the content after this character must appear at the end of the row. ^$: matches a blank line. []: Represents any single character within the specified range of matches. [^]: represents any single character outside the specified range. Note: Use the following match to use two square brackets, such as [[: Alpha:]][:alnum:] [: Alpha:] [: Blank:] [: cntrl:][:d Igit:] [: Graph:] [: Lower:] [:p rint:][:p UN CT:] [: Space:] [: Upper:] [: xdigit:]\<: Indicates that any character following it must appear as the header of the word. \>: Indicates that any character preceding it must appear as a single tail. The above two, can also be expressed in \b. Such as: \broot indicates that Root appears at the beginning of the word. root\b indicates that root appears in the suffix. \<root\>: The root of the expression must appear at the beginning and ending of the word. \ (\): Groups the strings as a whole.
This article from "Love Open source, happy to share!" "Blog, be sure to keep this provenance http://hezhanglinux.blog.51cto.com/10861477/1711113
Bash Series (3)--bash pass-through wildcards regular expression