unicode-emoji-regex
v0.3.0
Published
unicode emoji spec as regex
Downloads
6
Readme
unicode-emoji-regex
While this tries to stay true to the specification, some liberties were taken to make this easier to use.
EMOJI
is non-standard, and isEMOJI_SEQUENCE | Emoji_Presentation | Extended_Pictographic
.EMOJI_CORE_SEQUENCE
does not includeEMOJI_CHARACTER
due toEMOJI_CHARACTER
matching potentially unwanted characters such as1
.
Example
import { EMOJI } from "./emoji.ts";
assertEquals(EMOJI.test("Hello World!"), false);
assertEquals(EMOJI.test("1"), false);
assertEquals(EMOJI.test("1️⃣"), true);
assertEquals(EMOJI.test("🏳️🌈"), true);
assertEquals(EMOJI.test("🏴☠️"), true);
assertEquals(EMOJI.test("🏳️⚧️"), true);
assertEquals(EMOJI.test("👋🏽"), true);
assertEquals(EMOJI.test("👋"), true);