Ben Terhechte β€” journal
--rss
TERHECH.DE #rust

Emojito: Find all Emoji in a string. Supports complex emoji such as family

Find Emoji in strings. Supports complex emoji such as πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦. Uses the unic-emoji-char crate in the background, and does not rely on regexes.

● Dec 30, 2022 β„– 634 1 min read 74 words

Emojito: Find all Emoji in a string. Supports complex emoji such as family

I’ve released a small new Rust crate which solves a kind of complex unicode problem: It helps finding Emoji in strings. Supports complex emoji such as πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦. Uses the unic-emoji-char crate in the background, and does not rely on regexes.

For example:

let content = "Test 😘❀️! πŸ˜»πŸ’“ πŸ‘¨β€πŸ‘©β€πŸ‘¦  kk πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦";
let emojis = emojito::find_emoji(content);
assert_eq!(emojis.len(), 6);

It, it correctly finds 6 emoji even though some of them are complex combinations of multiple emojis.