Tag code validation