import fnmatch
import re


def convertPatternsToRegexp(patterns):
    """Converts multiple file name patterns to single regular expression"""
    if not patterns:
        return None
    fullRe = ""
    for pattern in patterns:
        reStr = fnmatch.translate(pattern)
        if fullRe:
            fullRe += "|"
        fullRe += "(" + reStr + ")"
    return re.compile(fullRe)