Created
August 20, 2015 08:09
-
-
Save ficapy/77cc75c67da836885fd2 to your computer and use it in GitHub Desktop.
不进行迭代文件使用正则匹配
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codecs | |
import re | |
import mmap | |
with codecs.open('a.txt', 'r+', 'utf-8') as f: | |
data = mmap.mmap(f.fileno(), 0) | |
print(re.findall(b'AccountType\=(.*)', data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment