I have 15 years of php coding under my belt, yet for the life of me, I cannot get preg_match_all to reliably count occurrences of a string that it locates. According to my many hours of research on this question, the following should locate all instances in which a string begins with two periods or full stops.
$pattern="/^\.\.[^.]"; preg_match_all($pattern, $str, $matches); $thisCount=count($matches);
However, this does not work, at least when I incorporate it into a script.
Can anyone help me figure out what I’m doing wrong when it comes to Preg_match_all???