Hi,
I've got the script below - However it does not work...
can you advise the error I have.. please - Explanation below....
==============
$test=implode("",$FILES);
echo "FILES\n$test\n";
if (preg_match("/.*\n\s*word1:\s*(.*?)\n\s*(word2:\s*.*?)\n\s*\n(.*)$/ims",
$test,$matches)){
echo "FOUND $matches[1]\n";
echo "FOUND 2 $matches[2]\n
";
==============
Basically,
$FILES, is the entire text of an inward email (headers & all..)
I looked on the web - Google - & found I need to 'implode' - To search
multi-lines...
(I tried to preg_match directly on $FILES - Still didnt work...)
Basically, I am looking for
(Blank line)
word1: (text here)\n
word2: (text here)\n
word2: (text here)\n
word2: (text here)\n
word2: (text here)\n
(blank line)
I'm looking for the phrase "word1", a semi colon, then ANY text before
the next \n
then the next line has "word2" a semicolon, then any text - And a new-line..
** There can be multiple instances of WORD2
and it stops on the next blank line - & saves it to $matches[1] & $matches[2]
Is the /ims correct - At the end (I want "i" - Case insensitive...)
Can anyone help - Thank you....
--
G
NZ community groups - [EMAIL PROTECTED]
Freecycle Auckland :-
http://groups.yahoo.com/group/AucklandFreecycle/