Hi,
        Could someone please point out where I've gone wrong with this regular
expression...?

$body="<a href=\"http://www.fred.com\";>my test</a> or <a
href=\"/show.asp?id=333\">here</a>";
$body=eregi_replace ("<a
href=\"([^\\[]*)\">([^\\[]*)</a>","[url=\"\\1\"]\\2[/url]",$body);

#$body should now be
[url="http://www.fred.com"]my test[/url] or
[url="/show.asp?id=333"]here[/url]
#but instead, it is
[url="http://www.fred.com";>my test</a> or <a
href=\"/show.asp?id=333\"]here[/url]
echo $body;

Thanks

- James

Editor, VB Web
==================
Web   - http://www.vbweb.co.uk
Email - [EMAIL PROTECTED]
ICQ#  - 60612011
Fax   - +44(0)8707052859
==================


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to