[PHP] Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread Nicklas af Ekenstam
Hi I'm trying to do some parsing of mail headers and since not all headers follow the pattern: X-Header-A: A string X-Header-B: Another string that is longer X-Header-C: And this string is very very long compared But may very well look like this: X-Header-A: A string X-Header-B: Another

Re: [PHP] Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread Analysis Solutions
On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote: In order to read the headers into an array of header key/value fields i would like a reg exp to remove all new lines/line feeds before a line starting with one or more white spaces or tabs. In ereg_replace() you can use

Re: [PHP] Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread Analysis Solutions
On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote: In order to read the headers into an array of header key/value fields i would like a reg exp to remove all new lines/line feeds before a line starting with one or more white spaces or tabs. Pardon my prior post. I