How do I remove emoji from string

前端 未结 10 2221
你的背包
你的背包 2020-11-28 10:44

My problem is to remove emoji from a string, but not CJK (Chinese, Japanese, Korean) characters from a string using regex. I tried to use this regex:

REGEX =         


        
10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 11:28

    CARE the answer from Aray have some side effects.

    "-".gsub(/[^\p{L}\s]+/, '').squeeze(' ').strip
    => ""
    

    even when this is suppose to be a simple minus (-)

提交回复
热议问题