How to delete characters that aren't letters (emojis, ★, etc.)

Hi, is there a way to delete all characters that aren’t letters? Some examples of characters that I want to de delete from the text in a variable:

  • :smiley:

If possible, it would be nice to also delete other characters like dots, commas, exclamations [ . | … | , | ; | ? ]

Many thanks for your help in advance.

only keep A-Z 0-9 and remove other characters from string using javascript - Stack Overflow

@LEE many thanks!

I managed to make the following command work. It replaces all characters except letters, numbers, dashes and spaces.

{
      "Command": "executeScript_Sandbox",
      "Target": "return ${text}.replace(/[^a-zA-Z0-9-\s]/g,'')",
      "Value": "text",
      "Description": ""
    },

So happy! :grinning: