zoukankan      html  css  js  c++  java
  • Learning_the_bash_Shell_Third_Edition 7/n(chapter 4, page[117|99])

    Extended Pattern Matching

    Operator

    Meaning

    *(patternlist)

    Matches zero or more occurrences of the given patterns.

    +(patternlist)

    Matches one or more occurrences of the given patterns.

    ?(patternlist)

    Matches zero or one occurrences of the given patterns.

    @(patternlist)

    Matches exactly one of the given patterns.

    !(patternlist)

    Matches anything except one of the given patterns.

    Some examples of these include:

    *(alice|hatter|hare) would match zero or more occurrences of alice, hatter, and hare. So it would match the null string, alice, alicehatter, etc.

    +(alice|hatter|hare) would do the same except not match the null string.

    ?(alice|hatter|hare) would only match the null string, alice, hatter, or hare.

    @(alice|hatter|hare) would only match alice, hatter, or hare.

    !(alice|hatter|hare) matches everything except alice, hatter, and hare.

    The values provided can contain shell wildcards too. So, for example, +([0-9]) matches a number of one or more digits. The patterns can also be nested, so you could remove all files except those beginning with vt followed by a number by doing rm !(vt+([0-9])).

  • 相关阅读:
    mysql show profiles 使用分析sql 性能
    面向对象三大特征---封装、继承、多态
    http_build_query用法,挺方便的
    请求数据
    多模匹配算法之Aho-Corasick
    php命名空间如何引入一个变量类名?
    MySQL错误:Can't connect to MySQL server (10060)
    Vim完全教程
    路由
    wireshark
  • 原文地址:https://www.cnblogs.com/winditsway/p/14473295.html
Copyright © 2011-2022 走看看