0.1.1 • Published 6 years ago

@regexp-extra/emoji-text v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

RegExp for matching emoji text.

Matches emoji in their textual representation as well (i.e. emoji that are not Emoji_Presentation symbols and that aren’t forced to render as emoji by a variation selector).

const EMOJI_TEXT = require('@regexp-extra/emoji-text');
// -> regular expression (global)


var str = `
:-)
\u{231A}:            ⌚ emoji presentation
\u{2194}\u{FE0F}:     ↔️ text presentation as emoji
\u{1F469}:           👩 emoji modifier base
\u{1F469}\u{1F3FF}:  👩🏿 emoji modifier base, modifier
`, match;
var re = new RegExp(EMOJI_TEXT);
while(match = re.exec(str)) {
  var emoji = match[0];
  console.log(`${emoji}: code points=${[...emoji].length}`);
}
// ⌚: code points=1
// ⌚: code points=1
// ↔️: code points=2
// ↔️: code points=2
// 👩: code points=1
// 👩: code points=1
// 👩🏿: code points=2
// 👩🏿: code points=2

NPM

credits: taken directly from mathiasbynens/emoji-regex.

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago