import re fqdns = [ "ad6.example.com", "ad4.example.com", "ad.example.com", "www.example.com", "pipa", ] pattern = re.compile( r"^((?![-])[-_A-Z\d]{1,63}(?