【发布时间】:2013-11-16 07:53:45
【问题描述】:
import re
import ply.lex as lex
#rest of the code
def t_WORD(t): #WORD is a token defined in the tokens tuple
r'[\u0C80-\u0CFF]+'
#rest of the actions
这个 sn-p 提供了一个错误说明非法字符。所有字符都在正则表达式规则中指定的 unicode 范围内。
可能是什么问题?提前致谢。
【问题讨论】:
标签: regex unicode python-3.x lex