** 全局字符是什么? [英] What is the ** glob character?

查看:25
本文介绍了** 全局字符是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 react gulpfile 中有这个路径:

I have this path in my react gulpfile:

var path = {
  HTML: 'src/index.html',
  ALL: ['src/js/*.js', 'src/js/**/*.js', 'src/index.html'],
  JS: ['src/js/*.js', 'src/js/**/*.js'],
  MINIFIED_OUT: 'build.min.js',
  DEST_SRC: 'dist/src',
  DEST_BUILD: 'dist/build',
  DEST: 'dist'
};

什么是双球字符?

我知道single glob 是什么...但是double 是什么?单个全局

I know what the single glob is... but what is the double? single glob

推荐答案

与单个星号几乎相同,但可能由多个目录级别组成.

It's almost the same as the single asterisk but may consist of multiple directory levels.

换句话说,虽然 /x/*/y 将匹配以下条目:

In other words, while /x/*/y will match entries like:

/x/a/y
/x/b/y

以此类推(通配符部分只有一个目录级别),双星号 /x/**/y匹配以下内容:

and so on (with only one directory level in the wildcard section), the double asterisk /x/**/y will also match things like:

/x/any/number/of/levels/y

任意数量的级别"的概念也包括零(换句话说,/x/**/y 将匹配 /x/y 作为一的选择).

with the concept of "any number of levels" also including zero (in other words, /x/**/y will match /x/y as one of its choices).

顺便说一句,尽管我不喜欢将任何东西归功于大型机,我相信这自 MVS 早期以来就已被用于允许在多个级别上选择数据集 :-)

As an aside, as much as I hate to credit the mainframe with anything, I believe this has been used since the earlist days of MVS to allow selection of datasets at multiple levels :-)

这篇关于** 全局字符是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆