Remove emoji from file name but keep Chinese/Japanese words

Advanced Renamer forum
#1 : 01/02-23 17:22
Mocha
Mocha
Posts: 2
Hi, guys and gals. Need some help here, thanks for reading and assists.

I try to rename a bunch of files, with some emojis on the filename.

Example: 1234 😋♥ •ä¸€äºŒä¸‰å›› 1
to
Result: 1234 一二三四 1

I try some method I found on forum.
Remove pattern: [^ a-z0-9]
Use regular expressions

But it will remove the Chinese/ Japanese words too. (Became 1234 1)

How to just remove emojis ONLY, instead of remove emojis and Chinese/ Japanese words?

I need some method for just remove EMOJIS.

Can somebody help?


01/02-23 17:22 - edited 01/02-23 17:23
#2 : 01/02-23 18:25
David Lee
David Lee
Posts: 1125
You are on the right lines. Simply add the Unicode range of Chinese characters to your list of excluded characters.

Common Han characters are in the hex range 4E00-9FFF so try using the pattern: [^a-z0-9\x{4E00}-\x{9FFF}]

Japanese and less common Chinese characters span other ranges - eg I believe Katakana characters lie in the range 30A0–30FF - so you may need to add additional ranges. Google is your friend!


01/02-23 18:25
#3 : 05/02-23 17:46
Mocha
Mocha
Posts: 2
Reply to #2:
Thank you so much!!!!! David Lee.

That's EXACTLY what I need it. So it called "Unicode range of", I just don't know what to search and where to start.

Thanks again for provide some tips.


05/02-23 17:46