Now this is both weird and it's now succeeded in pissing me off.
Code:
$string = "Well Hellooooooo, Nurse!";
$tag_start = "";
$tag_end = "";
$tag_newstart = "<b>";
$tag_newend = "</b>";
$refined = eregi_replace("\$tag_start(.+)\$tag_end", "\$tag_newstart\1\$tag_newend", $string);
echo $refined;
It works exactly as wanted...almost. It outputs:
Well <b>Hellooooooo, Nurse!</b>
How in hell did those escapes make it in there? I don't see how it is that two extra "\" make it into the output, so perhaps someone could solve both of our problems?
Now I'm perplexed...