python正则表达匹配汉字
2013-01-06 17:21
190 查看
import os
import codecs
import re
'''
Created on 2012-3-29
'''
log = codecs.open('wiki/tt.txt','r','gbk')
line = log.readline()
m = re.match(ur"[\u4e00-\u9fa5]",line[4])
if m is None:
print 'none'
else:
print 'yes'
import codecs
import re
'''
Created on 2012-3-29
'''
log = codecs.open('wiki/tt.txt','r','gbk')
line = log.readline()
m = re.match(ur"[\u4e00-\u9fa5]",line[4])
if m is None:
print 'none'
else:
print 'yes'
相关文章推荐
- Python 语言及其应用 Chapter_7_Note 1 正则表达匹配
- python 中文正则表达匹配
- python3中正则表达式匹配字母,数字和汉字的任意组合
- python中如何用正则表达式匹配汉字
- python中如何用正则表达式匹配汉字
- 用python处理时间、utf8文本、正则匹配、序列化、目录路径搜索、xml解析
- Python 正则表达式匹配XML1.1的名字
- Python中匹配IP的正则表达式
- Python正则表达式匹配操作re模块
- Python中正则表达式的一些匹配规则
- 【Python3 爬虫】09_正则表达式(re.math()、re.search()、re.sub()、全局匹配函数)
- Python:正则表达式匹配任意字符(包括换行符)的写法
- python 正则表达式:匹配字符串开头并打印
- utf8下汉字匹配正则表达式的规则
- 正则表达式的汉字匹配
- Python 正则表达
- 匹配中文汉字的正则表达式介绍
- python类库31[正则表达式匹配实例]
- python中 正则表达式匹配一个反斜杠 ‘\’
- python里使用正则表达式来替换匹配成功的组