Skip to main content
Solved

Find and replace all emoticons in text field

  • September 2, 2021
  • 4 replies
  • 141 views

Forum|alt.badge.img+8

Is there any way to search for emoticons (any of them) in a text field, and replace with something like a dash or space? Is there a code for emoticon that allows a formula to search for this?

Emojis and emoticons are often put into titles of blogs, but I am curating titles and creating url’s out of them, but want to remove any trace of these.

Best answer by Justin_Barrett

This is a great use case for regular expressions, and the regex engine that Airtable uses supports the [[:ascii:]] character class, which will only match normal ASCII characters: letters, numbers, and limited special characters, but no emojis. This formula will replace anything not in that category with an empty string, but you can use whatever substitute character you prefer.

REGEX_REPLACE(Title, "[^[:ascii:]] *", "")

4 replies

Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • September 4, 2021

This is a great use case for regular expressions, and the regex engine that Airtable uses supports the [[:ascii:]] character class, which will only match normal ASCII characters: letters, numbers, and limited special characters, but no emojis. This formula will replace anything not in that category with an empty string, but you can use whatever substitute character you prefer.

REGEX_REPLACE(Title, "[^[:ascii:]] *", "")


Forum|alt.badge.img+8
  • Author
  • Known Participant
  • September 6, 2021

This was exactly what I needed. You da man! Thank you soooooo much. :slightly_smiling_face:


Forum|alt.badge.img+1
  • New Participant
  • November 23, 2023

Hi everyone, 

Thank you very much for the formula.

However, it also removes accents.
My canadien customer René now has a first name of Ren.

Is there a way to remove emojis and keep accents ?


Forum|alt.badge.img+6
  • Known Participant
  • December 18, 2023

Hi everyone, 

Thank you very much for the formula.

However, it also removes accents.
My canadien customer René now has a first name of Ren.

Is there a way to remove emojis and keep accents ?


This works even better for me:

REGEX_MATCH(Titel, '[^\\u0000-\\ud7ff\\ue000-\\uffff]')