<?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:
45.12 ms | 402 KiB | 5 Q