python用正则表达式怎么查询unicode码字符

import re


data = open(‘a.txt‘)

fh = open(‘b.txt‘, ‘w‘)

"""Search the string begining with ‘【‘"""

p = re.compile(r‘\s*[\u3010]‘)
for each_d in data:
    if re.match(‘\s*3\d{4}‘, each_d):
        each_d = each_d.strip()
        print(each_d + ‘: ‘, end=‘‘)
    elif p.match(each_d):
        print(each_d, end=‘‘)

python用正则表达式怎么查询unicode码字符,布布扣,bubuko.com

python用正则表达式怎么查询unicode码字符

上一篇:可以进行自动补全的python的eclipse配置方法


下一篇:Window上python开发--4.Django的用户登录模块User