astral-regex (2.0.0)

Published 2026-02-24 13:53:06 +00:00 by atheaadmin

Installation

registry=
npm install astral-regex@2.0.0
"astral-regex": "2.0.0"

About this package

astral-regex Build Status

Regular expression for matching astral symbols

Install

$ npm install astral-regex

Usage

const astralRegex = require('astral-regex');

astralRegex({exact: true}).test('🦄');
//=> true

'foo 🦄 💩 bar'.match(astralRegex());
//=> ['🦄', '💩']

API

astralRegex([options])

Returns a RegExp for matching astral symbols.

options

Type: Object

exact

Type: boolean
Default: false (Matches any astral symbols in a string)

Only match an exact string. Useful with RegExp#test() to check if a string is a astral symbol.

License

MIT © Kevin Mårtensson

Dependencies

Development Dependencies

ID Version
ava ^1.4.1
tsd ^0.7.2
xo ^0.24.0

Keywords

astral emoji regex surrogate
Details
npm
2026-02-24 13:53:06 +00:00
1
Kevin Mårtensson
MIT
latest
1.8 KiB
Assets (1)
Versions (1) View all
2.0.0 2026-02-24