Home  >  Article  >  Backend Development  >  求个正则表达式

求个正则表达式

WBOY
WBOYOriginal
2016-06-06 20:24:571138browse

[quote]3333[/quote]
匹配quote,然后把之间的内容都提取出来
用php~

回复内容:

[quote]3333[/quote]
匹配quote,然后把之间的内容都提取出来
用php~

只要quote中间部分的话

<code class="php">$matches = [];
$re = "/\\[quote\\](\\S*?)\\[\\/quote\\]/"; 
$str = "[quote]3333[/quote]\n"; 
 
preg_match($re, $str, $matches);

print_r($matches);</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn