Published
Edited
Aug 26, 2020
1 star
Insert cell
md`# Emoji filtering`
Insert cell
Insert cell
emojiRegex = /<% emojiSequence %>|\p{Emoji_Presentation}|\p{Emoji}\uFE0F|\p{Emoji_Modifier_Base}/gu

Insert cell
Insert cell
Insert cell
stringz.map(s => `${s} -> ${s.replace(emojiRegex, 'X')}`).join('\n')
Insert cell
Insert cell
Insert cell
matchedEus = eu.filter(e => {
return e.emoji.match(er2)
})
Insert cell
html`<table>
<th>Symbol<th>CharCode
${matchedEus.map(m => `
<tr><td>${m.emoji}<td>${m.code}</tr>
`)}
</table>`
Insert cell
matchedEus.map(m => `${m.emoji} - ${m.code}`)//.join('\n')
Insert cell
uniRegex = /[\u2000-\u206F\u2E00-\u2E7F]/g
Insert cell
"⌚".codePointAt(0)
Insert cell
(9997).toString(16)
Insert cell
e = String.fromCharCode(8986)
Insert cell
"我的气垫船充满了鳗鱼".match(er2)
Insert cell
Insert cell
unfiltered = allEmojis.filter(emoji => {
let matches = emoji.match(emojiRegex)
return (matches === null)
})
Insert cell
"👁‍🗨".length

Insert cell
unfiltered.map(thing => ({emoji: thing, codePoints: (
thing.split('').map(char => char.charCodeAt(0))
) }))
Insert cell
"👁‍🗨".match(er2)
Insert cell
"👁‍".match(emojiRegex)
Insert cell
"👁".match(er2)
Insert cell
"👁".split('')
Insert cell
'\ud83d\udc41'.match(emojiRegex)

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more