4d8ef4c3b938acfa4d0a774973a30d242da90503a3930646e91713fe3da9bf2a50d8a79e6e2c91d471d5730759fac84c0ddd0d2fbe661170dfcd600003e7fb 839 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex)
  2. > Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane)
  3. ## Install
  4. ```
  5. $ npm install astral-regex
  6. ```
  7. ## Usage
  8. ```js
  9. const astralRegex = require('astral-regex');
  10. astralRegex({exact: true}).test('🦄');
  11. //=> true
  12. 'foo 🦄 💩 bar'.match(astralRegex());
  13. //=> ['🦄', '💩']
  14. ```
  15. ## API
  16. ### astralRegex([options])
  17. Returns a `RegExp` for matching astral symbols.
  18. #### options
  19. Type: `Object`
  20. ##### exact
  21. Type: `boolean`<br>
  22. Default: `false` *(Matches any astral symbols in a string)*
  23. Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol.
  24. ## License
  25. MIT © [Kevin Mårtensson](https://github.com/kevva)