Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

        def get_hostmask_regex(mask):
    """Return a compiled `re.RegexObject` for an IRC hostmask"""
    result = ''
    for char in mask:
        if char == '*':
            result += '.*'
        else:
            result += re.escape(char)
    return re.compile(result, re.I)
        


src/w/i/willie-HEAD/willie/bot.py   willie(Download)
            def match_host_or_nick(pattern):
                pattern = tools.get_hostmask_regex(pattern)
                return bool(
                    pattern.match(origin.nick) or
                    pattern.match('@'.join((origin.nick, origin.host)))