'Converts the object\'s pattern into an unanchored regular expression.
Static file patterns can contain single- and double-wildcards. \'**\'
represents zero or more directories in a path, and \'*\' represents zero or
more characters in a file or directory name.
Args:
filename: a resource or static file pattern.
Returns:
regular expression version of the pattern. For example, a filename of
\'foo/**.txt\' becomes \'foo\/.*\.txt\'.'

def _CreateFileNameRegex(self, filename):

    return re.escape(filename).replace('\\*\\*', '.*').replace('\\*', '[^/]*')
