I'm using below code to do some cleaning of a string. However, it is not able to remove emoticons like " ". Is there a way to do it?
import re
import string
s = '''Hi !こんにちは、私の給料は月額10000ドルです。 XO XO
私はあなたの料理が大好きです
私のフライトはAPX1999です。
私はサッカーの試合を見るのが大好きです。
'''
# replace all ascii chars 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
replaced = re.sub(f'[{string.printable}]', '', s)
print(replaced)
Output :
こんにちは、私の給料は月額ドルです。私はあなたの料理が大好きです私のフライトはです。私はサッカーの試合を見るのが大好きです。
Expected output :
こんにちは、私の給料は月額ドルです。私はあなたの料理が大好きです私のフライトはです。私はサッカーの試合を見るのが大好きです。