Hi, I am trying to use the eregi_replace function in a forum I am creating to handle some vB code. Focusing on the and [/b ] tags, I first tried this:
$text2 = eregi_replace('()[b](.+)[\/b]()',"\1<b>\2</b>\3",$text2);
Which "works", but pairs the first with the last [/b ] of the post. I read on the net that what I was supposed to use was a lazy quantifier like +? instead of +, that would match the first [/b ] instead of the last. However, the resulting regexp:
$text2 = eregi_replace('()[b](.+?)[\/b]()',"\1<b>\2</b>\3",$text2);
turns $text2 in an empty string... I've tried various combinations, and I always get the same result. Any ideas?
TIA,
Kinniken