Skip to content

Instantly share code, notes, and snippets.

@tahadostifam
Created January 3, 2025 18:58
Show Gist options
  • Select an option

  • Save tahadostifam/48a74bac1b2c9acefad5f3d0577cccbe to your computer and use it in GitHub Desktop.

Select an option

Save tahadostifam/48a74bac1b2c9acefad5f3d0577cccbe to your computer and use it in GitHub Desktop.
fn is_emoji(ch: char) -> bool {
(ch >= '\u{1F600}' && ch <= '\u{1F64F}') // Emoticons
|| (ch >= '\u{1F300}' && ch <= '\u{1F5FF}') // Miscellaneous Symbols and Pictographs
|| (ch >= '\u{1F680}' && ch <= '\u{1F6FF}') // Transport and Map Symbols
|| (ch >= '\u{1F700}' && ch <= '\u{1F77F}') // Alchemical Symbols
|| (ch >= '\u{1F780}' && ch <= '\u{1F7FF}') // Geometric Shapes Extended
|| (ch >= '\u{1F800}' && ch <= '\u{1F8FF}') // Supplemental Arrows-C
|| (ch >= '\u{1F900}' && ch <= '\u{1F9FF}') // Supplemental Symbols and Pictographs
|| (ch >= '\u{1FA00}' && ch <= '\u{1FA6F}') // Chess Symbols
|| (ch >= '\u{1FA70}' && ch <= '\u{1FAFF}') // Symbols and Pictographs Extended-A
|| (ch >= '\u{2600}' && ch <= '\u{26FF}') // Miscellaneous Symbols
|| (ch >= '\u{2700}' && ch <= '\u{27BF}') // Dingbats
|| (ch >= '\u{2300}' && ch <= '\u{23FF}') // Miscellaneous Technical
|| (ch >= '\u{2B50}' && ch <= '\u{2B50}') // Star emoji (included for general cases)
|| (ch == '\u{1F004}' || ch == '\u{1F0CF}') // Card game symbols
|| (ch == '\u{1F003}') // Mahjong tile emoji
|| (ch == '\u{1F3C1}' || ch == '\u{1F3C2}') // Racing flags
|| (ch == '\u{2764}' || ch == '\u{1F49C}') // Heart emojis
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment