preg_match_all returning an empty array

ainsley

New Member
I'm developing a WordPress Plugin and I've ran into a serious problem with getting the correct information from a regular expression. Code for the regular expression is below:\[code\]preg_match_all("|grass1(.*)grass2|i", $split[1], $out);\[/code\]The output is an empty array. $split[1] is the body of the email (as a string).I'm looking to extract all the information between grass1 & grass2. So in the body of the email(as a string) there exists "grass1 Something Something grass2" which I need Something Something as an output. This is where the problem lies and it's wierd because it works if the string is the subject, header or the entire email it works just fine. So I'm confused on what is going on. Any help on understanding the problem will be helpful.Sample of the body of the email:\[code\]"_NextPart_000_0098_01CE2BC1.BFAF9200 Content-Type: text/plain charset="us-ascii" Content-Transfer-Encoding: 7bit grass1 I'm testing the before or after function. If successful you should see all of this message in a future email. grass2" \[/code\]
 
Back
Top