吕君喜 406d880ac6 first | vor 3 Jahren | |
---|---|---|
.. | ||
LICENSE | vor 3 Jahren | |
README.md | vor 3 Jahren | |
index.js | vor 3 Jahren | |
package.json | vor 3 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.