the traditional way to do this (ie, the C way) is
for($i=0;$i<strlen($the_file);$i++)
if($the_file[$i]=='.')
$the_file[$i]='*';
this is easily modified to only replace stuff outside of carets (pointy brackets) by using a toggle. when you hit an open caret you turn replacement off, when you hit a close caret you turn it back on... viz.
$replace = true;
for($i=0;$i<strlen($the_file);$i++)
{
if($the_file[$i]=='<')
$replace = false;
if($the_file[$i]=='>')
$replace = true;
if($replace && ($the_file[$i]='.')
$the_file[$i]='*';
}
note that i haven't tested this at all, it's just off the top of my head, but it should work.
also note that you cannot put carets in your body copy that are not part of html tags... you'll need to use the lt/gt codes! you can make the above a bit more robust by adding some counters to see if the number of open and close carets is equal, ie
$replace = true;
for($i=0;$i<strlen($the_file);$i++)
{
if($the_file[$i]=='<')
{$replace = false;$ltcount++;}
if($the_file[$i]=='>')
{$replace = true;$gtcount++}
if($replace && ($the_file[$i]='.')
$the_file[$i]='*';
}
if($gtcount != $ltcount)
echo "you have unmatched carets!!!";
really, all regular expressions are is a nice syntax to control this byte-by-byte march through a string. often it's faster and easier to do the marching yourself!