我对 python split 有一个问题,我无法弄清楚我缺少什么导致 split 函数无法正常工作。我以前一直在使用类似的拆分,它们工作得很好。
content=open(file).read)()
Sep = content.split(r'Document [a-zA-Z0-9]{25}\n')
我正在阅读的文件非常简单:
"I like coffee.
Document CLASSAR020181030eeat0000l
I like tea as well.
Document CLASSAR020181030eeat0000l
I like both coffee and tea."