def _Glob2Regex(self, glob_pattern):
<EOL>fnmatch_regex = fnmatch.translate(glob_pattern)<EOL>for suffix in (r'<STR_LIT>', r'<STR_LIT>'):<EOL><INDENT>if fnmatch_regex.endswith(suffix):<EOL><INDENT>fnmatch_regex = fnmatch_regex[:-len(suffix)]<EOL><DEDENT>if fnmatch_regex.startswith('<STR_LIT>'):<EOL><INDENT>fnmatch_regex = fnmatch_regex[len('<STR_LIT>'):]<EOL><DEDENT><DEDENT>return fnmatch_regex.replace('<STR_LIT>', '<STR_LIT:/>')<EOL>
Converts a glob pattern to a regular expression.

        Args:
          glob_pattern (str): glob pattern.

        Returns:
          str: regular expression of the glob pattern.

        Raises:
          ValueError: if the glob pattern cannot be converted.