'Get the corresponding regex for any routing key.'

def key_to_pattern(self, rkey):

    return (u'^%s$' % u'\\.'.join((self.wildcards.get(word, word) for word in escape_regex(rkey, u'.#*').split(u'.'))))
