regex help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to remove all the headers in a text file.

I tried this preg_replace('/^.*\n/', '',$body) but it only removed the
first one.

start of document-> Content-Type: text/plain
Content-Transfer-Encoding: 8bit
X-Input-Content-Type: application/msword
X-Translator-Status: translating

remove up to here ->This is the body of the document asdfdsafasdf

Re: regex help

Quoted text here. Click to load it

It matches up to the first line-feed character.  You want it to match
up to the first occurrence of two consecutive line-feeds (the first two
consecutive carriage-return/line-feed pairs, \r\n\r\n, perhaps?).
Remember the s modifier so that the dot matches any single line-feeds.



Re: regex help wrote:
Quoted text here. Click to load it


Justin Koivisto, ZCE -

Site Timeline