I found a solution along these lines worked for me...it may help you out...
I use this particular one to work with a CMS I am developing that allows image uploads to a news story image directory. But it can easily be modified to work with urls pointing to images elsewhere on the web (see the array at the bottom of this message).
I startout with a field I retrieve as $bodytest... let's say it says:
Blah blah blah blah blah.
I set a variable: $images_path to http://www.urlhere.com/ or http://www.urlhere.com/images, etc. ,etc. depending on where you store your images.
I have the following array set up to translate.
$tags=array
(
'#[img=(.?)](.?)[/img]#msi' => '<img src="'.$images_path.'\1" hspace="5" vspace="5" align="\2">'
);
Before I display my $bodytext I run it through the filter:
$bodytext=preg_replace(array_keys($tags), array_values($tags), $bodytext);
Which changes:
Blah blah blah blah blah.
into:
<img src="http://www.urlhere.com/shirt.gif" hspace="5" vspace="5" align="right">Blah blah blah blah blah.
I'm going to play around with patterns a bit to throw more variables in as needed.
The full array I found is below, in case it will help suit your larger needs.
It was developed by a guy going by the name of trib4lmaniac -- at an, um, 'other' coding site forum.
I just modified an img tag to suit my needs.
<?
$tags=array
(
'#[b](.?)[/b]#msi' => '<strong>\1</strong>',
'#[i](.?)[/i]#msi' => '<em>\1</em>',
'#[u](.?)[/u]#msi' => '<u>\1</u>',
'#[s](.?)[/s]#msi' => '<s>\1</s>',
'#[url](.?)[/url]#msi' => '<a href="\1">\1</a>',
'#[url=(.?)](.?)[/url]#msi' => '<a href="\1">\2</a>',
'#[img=(.?)]#msi' => '<img src="\1">',
'#[font=(.?)](.?)[/font]#msi' => '<font face="\1">\2</font>',
'#[size=(.?)](.?)[/size]#msi' => '<font size="\1">\2</font>',
'#[color=(.?)](.?)[/color]#msi' => '<font color="\1">\2</font>',
'#[left](.?)[/left]#msi' => '<div align="left">\1</div>',
'#[right](.?)[/right]#msi' => '<div align="right">\1</div>',
'#[center](.*?)[/center]#msi' => '<div align="center">\1</div>'
);
?>
Hope this helps.