see if this works, its a little tricky cause you never know if the site will do it like
name="keywords" content='stuff' />
or
name=keywords content=stuff>
etc. so i think that should catch it with " ' and nothing there, as well as the xml standard / at the end of the tag.
$pattern = "<meta name=.?KEYWORDS.? content=('|\")?(.*?)('|\"|/)?>/i";
$m = preg_match($pattern, $subject, $matches);
if ($m) {
echo $matches[2];
}