import re
import fnmatch


def matches(what, where):
    """
    Checks if the given string matches against the given list of glob patterns

    :arg str what: String that we want to test if matches
    :arg list where: list of glob patters to match
    """
    for pattern in where:
        if re.match(fnmatch.translate(pattern), what):
            return True
    return False