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])).

  • 相关阅读:
    search支持多种标签
    二级导航样式
    内容页与首页列表页调用点击数量
    常用标签
    20随机验证码
    19.请输入整数
    18.自定义过滤器表头排序
    17.js实现金山打字
    16.简单的自定义指令
    OC学习笔记 面向对象 继承与组合
  • 原文地址:https://www.cnblogs.com/winditsway/p/14473295.html
Copyright © 2011-2022 走看看