Can i replace a big text like During the day, abc is working. with new text abc is happy to work. using only regular expressions. This was asked in some text papers. And it also said that code cannot be more then 2 lines.
/* update */
I have written code like
<?php
echo preg_replace(array('/During the day,/','/is/'), array('','is happy to'), 'During the day, Damien is working');
?>
and it worked. Just wanted to know if it can be better.
I believe you are looking for is preg_replace() http://php.net/manual/en/function.preg-replace.php. If you need to test your regex, I recommend http://gskinner.com/RegExr/