import re


def wild_to_regex(string):
    """Transforms wildcard searches into regular expressions."""
    regex = re.escape(string)
    regex = regex.replace(r'\*', '.*')
    regex = regex.replace(r'\?', '.')
    return regex