PHP regex help with preg_match_all
- by Steve
Hi, I am trying to refine a preg_match_all by finding the second occurrence of a period then a space:
<?php
$str = "East Winds 20 knots. Gusts to 25 knots. Waters a moderate chop. Slight chance of showers.";
preg_match_all ('/(^)((.|\n)+?)(\.\s{2})/',$str, $matches);
$dataarray=$matches[2];
foreach ($dataarray as $value)
{ echo $value; }
?>
But it does not work: the {2} occurrence is incorrect.
I have to use preg_match_all because I a scraping dynamic HTML.
I want to capture this from the string:
East Winds 20 knots. Gusts to 25 knots.
Any ideas? Thx