这可能很简单,但我无法弄明白: 我需要正则表达式,它将提取以下记录(每条记录可能跨越多行并由一个或多个空行分隔):
TextTextTextTextTextTextText
TextTextTextTextTextTextTextTextText
(一个或多个空白行)
TextTextTextTextText
TextTextText
TextTextTextTextTextTextText
(一个或多个空白行)
TextTextTextTextText TextTextTextTextTextTextTextTextTextText
答案 0 :(得分:4)
import re
re.split('\n\n+', text)