Php 正则表达式检索“| Description=”和“| Category”之间的所有内容
鉴于以下案文:Php 正则表达式检索“| Description=”和“| Category”之间的所有内容,php,regex,Php,Regex,鉴于以下案文: |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 .
|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
使用此模式\|Description=..\\\\\\\\\\\\\\\\\\\\\\\\\类别=使用此模式\|Description=.\\\\\\\\\\\类别=使用此模式
(?<=\|Description=)(.*)(?=\|Category)
使用点全部和多行标志运行它。使用此模式
(?<=\|Description=)(.*)(?=\|Category)
使用点全部和多行标志运行它。谢谢,这是有效的。出于兴趣,为什么preg_会匹配“/?@MichaelP:对不起,我不知道为什么会这样:谢谢,这很有效。出于兴趣,为什么preg_会匹配“/?@MichaelP:对不起,我不知道为什么会这样: