preg_match
| From: | Sorry Confidential | Date: | Tue, 13 Apr 2004 22:52:40 +0000 |
| Subject: | preg_match | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-183304@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to parse a POstfix queue file to extract a few informations. The
Postfix queue file is a binary file.
Here is an extract of the file, not a line, just an extract:
N^WFrom: <digital@sex.com>N^[To: <user@domain.com>N#Subject: Test 14
2004-04-13 15:13N%Date: Tue, 13 Apr 2004 15:13:35 -0400
$line is obtained with an fread
if (preg_match('/To:.<(.+)>/',$line,$match)){
print "To= $match[1]";
}
I get:
To= <user@domain.com>N#Subject: Test 14 2004-04-13 15:13N%Date: Tue, 13
Apr 2004 15:13:35 -0400
I was expecting:
To= user@domain.com
Obviously, i'm missing a detail..
Regards