Alright, I'm trying to replace URLs in a string to make "<a href...", and that works perfectly, but it conflicts with an IMG tag inside the string...
I have:
$body=eregi_replace("\[img]([[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/])\[/img]","<img src=\"\\1\" />",$body);
$body=eregi_replace("([[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/])","<a href=\"\\1\">\\1</a>",$body);
I've tried putting "(?<!\")" at the beginning so it doesn't match things with quotes before it, but I keep getting an error:
[b]Warning:[/b] REG_BADRPT:trepetition-operator operand invalid in [b]d:\apache\htdocs\bbs\thread.php[/b] on line [b]41[/b]
Can anyone help me?