求个正则表达式

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

阅读 2.2k
1 个回答

只要quote中间部分的话

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

print_r($matches);
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题