<?php
var_dump(preg_match('#<(link)(\s[^>]*|)>#i', '<link>', $matches));var_dump($matches);
var_dump(preg_match('#<(link)(\s[^>]*|)>#i', '<link/>', $matches));var_dump($matches);
var_dump(preg_match('#<(link)(\s[^>]*|)>#i', '<link rel=test>', $matches));var_dump($matches);
var_dump(preg_match('#<(link)((?:\s[^>]*)?)>#i', '<link>', $matches));var_dump($matches);
var_dump(preg_match('#<(link)((?:\s[^>]*)?)>#i', '<link/>', $matches));var_dump($matches);
var_dump(preg_match('#<(link)((?:\s[^>]*)?)>#i', '<link rel=test>', $matches));var_dump($matches);
preferences:
34.67 ms | 402 KiB | 5 Q