This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients Arfrever, christian.heimes, fweimer, iankko, mpessas, pitrou, tim.peters, timehorse
Date 2013-05-16.18:10:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
We could use an algorithm that doesn't need regexp for most cases.

pseudo code:

value = value.lower()
hostname = hostname.lower()

if '*' not in value:
   return value == hostname

vparts = valuesplit(".")
hparts = hostname.split(".")
if len(vparts) != len(hparts):
    # * doesn't match a dot
    return False

for v, h in zip(vparts, hparts):
    if v == "*":
        # match any host part
    asterisk = v.count("*")
    if asterisk == 0:
        if v != h:
            return False
    elif asterisk == 1:
        # match with simple re
        # don't support more than one * in a FQDN part
        raise TooManyAsterisk
Date User Action Args
2013-05-16 18:10:43christian.heimessetrecipients: + christian.heimes, tim.peters, pitrou, timehorse, Arfrever, iankko, fweimer, mpessas
2013-05-16 18:10:43christian.heimessetmessageid: <>
2013-05-16 18:10:43christian.heimeslinkissue17980 messages
2013-05-16 18:10:43christian.heimescreate