Bash Series (3)--bash pass-through wildcards regular expression

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.