note 102374 deleted from ref.pcre by danbrown

[email protected] Fri, 11 Feb 2011 06:57:52 -0800
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: gabriel_juchault at msn dot com 

----

function preg_count($pattern, $subject, $flags=PREG_PATTERN_ORDER, $offset=0) {
    $i;
    return $r = preg_match_all($pattern, $subject, $i, $flags, $offset);
}

Clearly than an :
echo preg_match_all($pattern, $subject, $shrink);
And the name preg_count is more expressive.