Currently I have a replace function that goes:
Code: Select all
$epost = eregi_replace('(\[url\])(.+)(\[\/url\])', '<a href="\\2">\\2</a>', $epost);
which basically makes any link between the url tags clickable. However, it currently matches the last possible url end tag there is, resulting in anything in between the first and last links on the page being linked. The solution is apparently to use lazy repetition instead, replacing the (.+) with (.+?), but this doesn't work in eregi_replace; I tried using preg_replace instead, but got an error message saying that it did not recognise the modifier '('.
Help would be greatly appreciated, thanks!