Search php.com for "eregi_replace", put the string (the url) in parenthesis in the pattern part and use \1 to recall it in the replacement part.
Just a note, it took the BB companies lots of time and efforts to make the url tag invulnerable, so if you just make it simple most likely hackers will be able to exploit it (for example, they can start the URL with "javascript:", add inverted commas to get out of href into another event, etc)