I have a long text store in $body variable. What I'm trying to do is get part of the text and leave the rest alone. I'm using preg_match but I can't seem to get it right. This is what I have preg_match("^/9(.+?)=^ism",$body,$matches); PHP: It starts with the /9 and it should continue untill it shows an = sign. It doesn't work though any ideas?