The existing pattern matching code:
val.find('*.') == 0 and name.find(val[1:]) + len(val[1:]) == len(name)
will return True in the following case:
val = '*.host.com'
name = 'blah.org'
since string.find() will return -1, len(val[1:]) == 9 and len(name) == 8.