Regex 正则表达式提取段落,包括制表符和新行参数

Regex 正则表达式提取段落,包括制表符和新行参数,regex,perl,Regex,Perl,我有一个字符串,其中包含以下格式的文本: $textOne\n; \t$textTwo\n; 例如: $textOne = Lorem Ipsum $textTwo = is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown print

我有一个字符串,其中包含以下格式的文本:

 $textOne\n;
 \t$textTwo\n;
例如:

$textOne = Lorem Ipsum
$textTwo = is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make 

Output is in the picture.

这是一个字符串。我想将每个部分(标题和选项卡段落)分解成它自己的元素,并将它们都放在一个数组中。我很难弄清楚到底用什么正则表达式模式来查找这个元素。如果我换了新行字符,标题和段落就会分开,这是不需要的


谢谢

为了回答我自己的问题,我使用了:

'\n(?!\t)'

您好,请考虑阅读。您的变量包含屏幕截图中显示的所有三个重复部分,还是只有其中一个?(我假设这三个都是,因为你在问如何将它们分开,但只是想确保,因为你的示例代码只显示了一个标题和选项卡式段落。)你首先如何设置变量的值?根据你的图,每个段落都有相同的文本和标题。另外,请在您的问题中提供更多详细信息。给出您迄今为止所尝试的(代码),并在这里给出一些有问题的文本,而不是图片中的文本。我看不出文本标记的示例如何符合第一块中显示的“格式”