grep_replace: unknown modifier

Posted by tic on Stack Overflow See other posts from Stack Overflow or by tic
Published on 2010-03-26T17:39:50Z Indexed on 2010/03/26 17:43 UTC
Read the original article Hit count: 456

Filed under:
|

Let assume that $body is equal to

something 
that 
does 
not 
interest 
me 
<!-- start -->
some
html
code
<!-- end -->
something
that
does
not
interest
me

If I use

$body=preg_replace("(.*)<!-- start -->(.*)<!-- end -->(.*)","$2",$body);

I obtain:

Warning: preg_replace() [function.preg-replace]: Unknown modifier '<' 

How have I to correct?

© Stack Overflow or respective owner

Related posts about php

Related posts about preg-replace