extglob NPM version Build Status

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

Usage

var 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)[^/]*?)).*$/

Extglob patterns

To learn more about how extglobs work, see the docs for Bash pattern matching:

Run tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on August 01, 2015.