python中正则表达式的使用详解(5)
def Chi2Num(line):
a = re.findall(u"[\u96f6|\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d]+\u5e74", line)
if a:
print "------"
print line
for words in a:
newwords = change2num(words)
print words
print newwords
line = line.replace(words, newwords)
return line
- 上一篇:Python入门篇之编程习惯与特点
- 下一篇:基于python编写的微博应用