def string_to_glob(string):
    """Create case-insensetive search pattern from the string.

    For example:
        '.otf' => '.[oO][tT][fF]'
    """
    return ''.join(
        '[{}{}]'.format(c.lower(), c.upper()) if c.isalpha() else c
        for c in string)