You can use this regular exprestion \[(.*?)\]\s*\((.*?)\) and replace with <a href="$2">$1</a> like so
preg_replace('/\[(.*?)\]\s*\((.*?)\)/', '<a href="$2">$1</a>', '[text](url)');
\[(.*?)\] select anything between [] and store it in first capture group
\((.*?)\) select anything between () and store it in first capture group
$1 use content of first capture group
preg_replace ( $pattern , $replacement , $subject )
take a look
Test if it works for you