UNPKG

681 BTypeScriptView Raw
1declare namespace astralRegex {
2 interface Options {
3 /**
4 Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. Default: `false` _(Matches any astral symbols in a string)_
5 */
6 readonly exact?: boolean;
7 }
8}
9
10/**
11Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane).
12
13@returns A `RegExp` for matching astral symbols.
14
15@example
16```
17import astralRegex = require('astral-regex');
18
19astralRegex({exact: true}).test('🦄');
20//=> true
21
22'foo 🦄 💩 bar'.match(astralRegex());
23//=> ['🦄', '💩']
24```
25*/
26declare function astralRegex(options?: astralRegex.Options): RegExp;
27
28export = astralRegex;