UNPKG
astral-regex
Version:
latest (2.0.0)
2.0.0
1.0.0
Regular expression for matching astral symbols
github.com/kevva/astral-regex
kevva/astral-regex
astral-regex
/
index.js
7 lines
(4 loc)
•
203 B
JavaScript
View Raw
1
2
3
4
5
6
7
'use strict'
;
const
regex =
'[\uD800-\uDBFF][\uDC00-\uDFFF]'
;
const
astralRegex
= options => options && options.
exact
?
new
RegExp
(
`^
${regex}
$`
) :
new
RegExp
(regex,
'g'
);
module
.
exports
= astralRegex;