protected function pregMatchAssetsByType($type, $haystack)
{
switch (strtolower($type)) {
case MinimeeType::Css:
$pat = "/<link{1}.*?href=['|\"]{1}(.*?)['|\"]{1}[^>]*>/is";
break;
case MinimeeType::Js:
$pat = "/<script{1}.*?src=['|\"]{1}(.*?)['|\"]{1}[^>]*>(.*?)<\\/script>/is";
break;
default:
return FALSE;
}
if (!preg_match_all($pat, $haystack, $matches, PREG_PATTERN_ORDER)) {
return FALSE;
}
return $matches[1];
}