Some time head will have attributes. https://developers.facebook.com/docs/reference/opengraph/object-type/article/ ``` })->unique()->implode("\n"); $replace = [ - '#<head>(.*?)#' => "<head>\n{$dnsPrefetch}" + '#<head[^>]*>(.*?)#' => "<head>\n{$dnsPrefetch}" ]; return $this->replace($replace, $buffer); ```