$post = preg_replace('/\[url=(.+?)\](.+?)\[\/url\]/', '<a href="\1">\2</a>', $post);
That will turn:
[url=http://google.com]Google[/url]
Into parsed bbcode text:
Google
You'll probably want to use more specific regex than just .+ to filter out potentially bad/dangerous input.