正则表达式:(?<=【)[^】]+
注:以匹配中文括号中内容为例,如果匹配非中文括号,则需要在括号前增加转义符
PHP实现示例:
<?php
$strSubject = abc【111】abc【222】abc【333】abc;
$strPattern = /(?<=【)[^】]+/;
$arrMatches = [];
preg_match_all($strPattern, $strSubject, $arrMatches);
var_dump($arrMatches);
执行结果:
~ » php mytest/test_preg.php