Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
不进行迭代文件使用正则匹配
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
You can’t perform that action at this time.