Re: REGEXP

From: Date: Mon, 16 Jul 2001 05:46:00 +0000
Subject: Re: REGEXP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58013@lists.php.net to get a copy of this message
Hi James, Thanks for your mail. But I think the problem like somewhere else. I have the following: echo $buffer; There result : Content-Type: multipart/mixed; This is wrong. It should be Content-Type: multipart/mixed; boundary="------------B42DA66C4EC07C9B572A58FC" I don't know why it is not reading the whole string. It seems to treat the *boundary* part as another line. I read somewhere the perl compatiable regexp can read a multiply line treating CRLF as part of the line. Any pointers Adrian On Sun, 15 Jul 2001, James Tan wrote: > hi,, > > u could try using explode function > eg: > > arrayresult = explode(string, separator); > > cont = explode(thestring, "\""); > > echo cont[0] ; > // result as > Content-Type: multipart/mixed; > boundary= > echo cont[1]; > //result as > ------------B42DA66C4EC07C9B572A58FC > echo cont[2]; > // array index 2 will be nothing.. null or "" > > hope it works.. > regards, > > James > > Adrian D'Costa wrote: > > > Hi, > > > > I am trying to capture the Header from a mail for my webmail using php and > > pop3. The header is something like this: > > Content-Type: multipart/mixed; > > boundary="------------B42DA66C4EC07C9B572A58FC" > > > > When I use preg_split("/[\d;]*/", $buffer), I get > > Content-Type: multipart/mixed; > > > > What I want is to return the whole line split by the ";". I usually try > > to avoid regexp (too lazy) but now I want to use it. The final result I > > would need is: ------------B42DA66C4EC07C9B572A58FC so that I can search > > in the body of the message for the rest of the parts. > > > > Any pointers would be helpful. > > > > Adrian > >

« previous php.general (#58013) next »