astral-regex

  • Version 2.0.0
  • Published
  • 3.4 kB
  • No dependencies
  • MIT license

Install

npm i astral-regex
yarn add astral-regex
pnpm add astral-regex

Overview

Regular expression for matching astral symbols

Index

Functions

Interfaces

Functions

function astralRegex

astralRegex: (options?: astralRegex.Options) => RegExp;
  • Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane).

    Returns

    A RegExp for matching astral symbols.

    Example 1

    import astralRegex = require('astral-regex');
    astralRegex({exact: true}).test('🦄');
    //=> true
    'foo 🦄 💩 bar'.match(astralRegex());
    //=> ['🦄', '💩']

Interfaces

interface Options

interface Options {}

    property exact

    readonly exact?: boolean;
    • 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)_

    Package Files (1)

    Dependencies (0)

    No dependencies.

    Dev Dependencies (3)

    Peer Dependencies (0)

    No peer dependencies.

    Badge

    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/astral-regex.

    • Markdown
      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/astral-regex)
    • HTML
      <a href="https://www.jsdocs.io/package/astral-regex"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>