That's a bad solution.
Generally, if you want to replace a specific character with other specific character(s) then use code like this:
<?php
$before='something';
$after=str_replace('e','eeeeee',$before);
print "<p>Before: '$before'; after: '$after'</p>";
?>
Regular expressions are nice - but much slower than a simple function like str_replace. So don't use regular expressions for simple cases.
By the way: It could sound like you are playing with something database related (and need to escape certain characters for your SQL query). If that's the case, then have a look at the fast and nice addslashes() function.