A better technique is to put the ereg_replace commands inside the required file and set some variables before you require the file that tell the required file how to behave.
For example, let's say you had a footer.php script that you wanted to require but you wanted the footer to behave a little differently each place the footer was called. Let's say you want the phone number to be 555-1111 on some pages and 555-2222 on other pages. You might do this:
$display_phone = "555-1212";
require("footer.php");
And then inside footer.php, you have something like this:
Our phone number is <? print "$display_phone"; ?> and you may call us anytime.
Or, to use an ereg_replace example, you might require the footer like this:
$replace_phone = "555-1111";
require("footer.php");
And your footer has this:
$string = (obtain some value from a database) ;
$string = ereg_replace("Insert Phone Number",$replace_phone);
print "$string";