6ff22e89d4ff2631506e9d0aa856f05b4254f590e7692ffaa60b58851fbdf311e572f2d58efae480035a25f67a722bea5e33f7635c52c7e8ef08e64f95af96 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # is-posix-bracket [![NPM version](https://img.shields.io/npm/v/is-posix-bracket.svg?style=flat)](https://www.npmjs.com/package/is-posix-bracket) [![NPM downloads](https://img.shields.io/npm/dm/is-posix-bracket.svg?style=flat)](https://npmjs.org/package/is-posix-bracket) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-posix-bracket.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-posix-bracket)
  2. > Returns true if the given string is a POSIX bracket expression (POSIX character class).
  3. ## Install
  4. Install with [npm](https://www.npmjs.com/):
  5. ```sh
  6. $ npm install is-posix-bracket --save
  7. ```
  8. ## Usage
  9. ```js
  10. var isPosixBracket = require('is-posix-bracket');
  11. isPosixBracket('[foo:]]');
  12. //=> false
  13. isPosixBracket('[xdigit:]]');
  14. //=> false
  15. isPosixBracket('[[:xdigit:]]');
  16. //=> true
  17. isPosixBracket('[[:xdigit:]]');
  18. //=> true
  19. isPosixBracket('[[:alpha:]123]');
  20. //=> true
  21. isPosixBracket('[[:alpha:]123]');
  22. //=> true
  23. isPosixBracket('[a-c[:digit:]x-z]');
  24. //=> true
  25. isPosixBracket('[:al:]');
  26. //=> true
  27. isPosixBracket('[abc[:punct:][0-9]');
  28. //=> true
  29. ```
  30. ## Related projects
  31. You might also be interested in these projects:
  32. * [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces)
  33. * [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets)
  34. * [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob)
  35. * [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob)
  36. * [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch)
  37. ## Contributing
  38. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-posix-bracket/issues/new).
  39. ## Building docs
  40. Generate readme and API documentation with [verb](https://github.com/verbose/verb):
  41. ```sh
  42. $ npm install verb && npm run docs
  43. ```
  44. Or, if [verb](https://github.com/verbose/verb) is installed globally:
  45. ```sh
  46. $ verb
  47. ```
  48. ## Running tests
  49. Install dev dependencies:
  50. ```sh
  51. $ npm install -d && npm test
  52. ```
  53. ## Author
  54. **Jon Schlinkert**
  55. * [github/jonschlinkert](https://github.com/jonschlinkert)
  56. * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  57. ## License
  58. Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
  59. Released under the [MIT license](https://github.com/jonschlinkert/is-posix-bracket/blob/master/LICENSE).
  60. ***
  61. _This file was generated by [verb](https://github.com/verbose/verb), v, on April 05, 2016._