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

sh $ npm i extglob --save

Used by micromatch.

Features

Usage

```js var extglob = require('extglob');

extglob('?(z)'); //=> '(?:z)?' extglob('(z)'); //=> '(?:z)' extglob('+(z)'); //=> '(?:z)+' extglob('@(z)'); //=> '(?:z)' extglob('!(z)'); //=> '(?!^(?:(?!z)[^/]?)).$' ```

Optionally return regex

js extglob('!(z)', {regex: true}); //=> /(?!^(?:(?!z)[^/]*?)).*$/

Extglob patterns

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

Related

Run tests

Install dev dependencies:

sh $ 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.