You can use another regex markup character:
return preg_replace('#.*#',
'Lorem Ipsum' .
'More Lorem Ipsum'
,
$foo);
EDIT:
The delimiter character is a feature of PCRE (Perl Compatible Regular Expresssion). PHP configuration is not required to use a different delimiter.
Regexp query-like operators
... -- . "/", LTS ( ).
, ASCII (, , , )
:
'/.*/'
'#.*#'
'{.*}' /* Note that '{.*{' would be incorrect. */
PHP PCRE Patterns, .