$pattern = "/\[(.*?)\]\((.*?)\)/i";
$replace = "<a href=\"$2\" rel=\"nofollow\">$1</a>";
$text = "blah blah [LINK1](http://example.com) blah [LINK2](http://sub.example.com/) blah blah ?";
echo preg_replace($pattern, $replace, $text);
上記は機能しますが、誤って [] と () の間にスペースが挿入された場合、すべてが壊れて 2 つのリンクが 1 つに混ざってしまいます。
$text = "blah blah [LINK1] (http://example.com) blah [LINK2](http://sub.example.com/) blah blah ?";
それを壊すのは怠惰な星だと感じていますが、繰り返しリンクを一致させる方法が他にわかりません。