Wik*_*żew 5

你似乎想要匹配一组特定的表情符号.

使用

package main

import (
    "fmt"
    "regexp"
)

func main() {
    var emojiRx = regexp.MustCompile(`[\x{1F600}-\x{1F6FF}|[\x{2600}-\x{26FF}]`)
    var s = emojiRx.ReplaceAllString("Thats a nice joke  ", `[e]`)
    fmt.Println(s)    
}

注意:

[\x{1F600}-\x{1F64F}][\x{1F680}-\x{1F6FF}]