【发布时间】:2020-04-02 05:50:35
【问题描述】:
import re
file = open('C:\item.bh.txt', 'r', encoding = 'utf-16')
pattern = re.findall(ur'[\u09ac][\u0995]', file)
它显示以下错误:
File "<ipython-input-22-bbd94837f9ee>", line 1 pattern = re.findall(ur'[\u09ac][\u0995]', file) ^ SyntaxError: invalid syntax
【问题讨论】:
-
你在使用 Python 2 吗?
-
我正在使用 python 3
-
@MaumitaBhaumik 由于以下答案对您有用,请考虑将其标记为已接受。
标签: python python-3.x regex unicode