UNPKG

emoji-regex-xs

Version:

A regular expression to match all emoji-only symbols

4 lines (3 loc) 201 B
const r = String.raw, e = r`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`; export default () => new RegExp(r`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${e}(?:\u200D${e})*`, 'gu');