给出以下文字:
|Description=This is the start of the ...
... <strong>description</strong> of a product that can span over multiple lines
|Category=Product
如何在 | Description = 和 | Category = Product 之间检索文本?
在上面的示例中,返回字符串应仅包含:
This is the start of the ...
... <strong>description</strong> of a product that can span over multiple lines
答案 0 :(得分:3)
使用此模式
(?<=\|Description=)(.*)(?=\|Category)
使用dot all
和multiline
标记运行它。
答案 1 :(得分:1)
使用此模式\|Description=(.*?)\|Category=