我这个小码括号内捕获文本的文本:如何捕捉括号内
$string = '[title=my title] http://bit.ly/gANFxi [maps:some cool place]';
preg_match_all('/\[([^\]]*)\]/', $string, $matches);
print_($matches[0]);
我得到的是以下几点:
Array( [0] => [title=my title] [1] => [maps:some cool place] )
我要让更多的限制,以避免“ [some-not cool]“或者”[another + stuff]“, ,所以我只需要抓住[some:thing]和[some = thing]。
我该怎么办?
就是这样!谢谢:D – greenbandit
世界需要更多的正则表达式专家 –
@AdamSack,世界需要更多的Chomskys。 – Godwin