📜  python代码示例中的grep替代

📅  最后修改于: 2022-03-11 14:46:16.291000             🧑  作者: Mango

代码示例1
import re
with open("filename") as origin_file:
    for line in origin_file:
        line = re.findall(r'something', line)
        if line:
           line = line[0].split('"')[1]
        print line