正则表达式使用汇总(不断更新)

1:匹配中括号里的内容

$str = '[user|get_nickname]xxx[time|time_format]xxxxx';
preg_match_all('/\[(\S+?)\]/', $str, $match);

你可能感兴趣的:(正则表达式)