[tag] regex validation [/tag] (bbcode style)

Does anyone know where I can find, or better, have the bbcode that validates, bold, italic and url (most important one) tags (using PHP)…

You know, when typing [ url=http://www.link.com ] (link) [ /url ] actually returns (link) , or just typing a url makes it a hyperlink: http://www.link.com

(the bold and italic tags should be quite easy to do)

I know there’s quite a few security issues with it so I don’t feel like building everything myself.