1:匹配中括号里的内容
$str = '[user|get_nickname]xxx[time|time_format]xxxxx'; preg_match_all('/\[(\S+?)\]/',$str,$match);