mac 安装 python 的 narrow bulid 导致 bad character range

 self.emoji_pattern = re.compile("["
                                           u"\U0001F600-\U0001F64F"  # emoticons
                                           u"\U0001F300-\U0001F5FF"  # symbols & pictographs
                                           u"\U0001F680-\U0001F6FF"  # transport & map symbols
                                           u"\U0001F1E0-\U0001F1FF"  # flags (iOS)
                                                              "]+", flags=re.UNICODE)

在处理表情符号的正则表达式时遇到bad character range报错

查到https://gist.github.com/admackin/0b677738a4b5648d307c中提到

The regex ranges below may not work on narrow builds of python < 3.3

see http://stackoverflow.com/a/25417872/1711188

sys.maxunicode == 0xffff is True


你可能感兴趣的:(python)