Eric Foster 35b96bc934 initial commit | vor 6 Jahren | |
---|---|---|
.. | ||
LICENSE | vor 6 Jahren | |
README.md | vor 6 Jahren | |
index.js | vor 6 Jahren | |
package.json | vor 6 Jahren |
Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.
Install with npm
$ npm i extglob --save
Used by micromatch.
Features
{regex: true}
to return a regexvar extglob = require('extglob');
extglob('?(z)');
//=> '(?:z)?'
extglob('*(z)');
//=> '(?:z)*'
extglob('+(z)');
//=> '(?:z)+'
extglob('@(z)');
//=> '(?:z)'
extglob('!(z)');
//=> '(?!^(?:(?!z)[^/]*?)).*$'
Optionally return regex
extglob('!(z)', {regex: true});
//=> /(?!^(?:(?!z)[^/]*?)).*$/
To learn more about how extglobs work, see the docs for Bash pattern matching:
?(pattern)
: Match zero or one occurrence of the given pattern.*(pattern)
: Match zero or more occurrences of the given pattern.+(pattern)
: Match one or more occurrences of the given pattern.@(pattern)
: Match one of the given pattern.!(pattern)
: Match anything except one of the given pattern.Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on August 01, 2015.