草庐IT

python - 一起使用 re.MULTILINE 和 re.DOTALL python

基本上输入文件是这样的:>U51677Humannon-histonechromatinproteinHMG1(HMG1)gene,completecds.#somerecordsdon'thavethisline(seebelow)Length=2575(sometext)>U51677Humannon-histonechromatinproteinHMG1(HMG1)gene,completeLength=2575(sometext)(etc...)现在我写这个来提取以>开头的行和长度的数字importreregex=re.compile("^(>.*)\r\n.*Length\s