javascript - node-glob 中 ** 和 * 的区别?
ringa_lee
ringa_lee 2017-04-10 15:24:58
[JavaScript讨论组]

如题,
没有看到太详细的解释

追加说明:是在gulpfile里:

function getFilters() {
    return {
        css: filter(['**/*.css']),
        less: filter(['**/*.less']),
        js: filter(['**/*.js']),
        coffee: filter(['**/*.coffee']),
ringa_lee
ringa_lee

ringa_lee

全部回复(3)
黄舟

LZ,gulpfile里面的**和*是node-glob提供的语法,而非正则表达式。

  • * Matches 0 or more characters in a single path portion
  • ** If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories.
ringa_lee

下面两张图说明了一切:

ringa_lee

一个 * 表示前面的表达式或一组表达式可以重复0次或N多次。

二个 ** 直接报错。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号