Check a tag has a name before matching against it