Couldn't get desired results via preg_match_all

حسايف

New Member
I am trying to program a email piping php script that would take an incoming traffic update report via email, and extract the relevant information within it to store into a database. The email usually starts with some introduction, with the important information displayed in the following format. \[code\]Highway : Some Highway Time : 08-Oct-2010 08:10 AM Condition : Smooth (or slow moving etc)\[/code\]I tried with this code\[code\]preg_match_all('/(?P<\name>\w+) : (?P<\data>\w+)/i', $subject, $result);\[/code\] Note the < / are really just < but somehow they are not being displayed here. And the matches are only:\[code\]Highway : SomeDatetime : 08Condition : Smooth\[/code\]Can anybody tell me what's missing in my second regex expression? Why doesn't it include the entire string of words after the ":"?
 
Back
Top