예제 #1
0
파일: paths.py 프로젝트: mmaj5524/grr
    def AsRegEx(self):
        """Return the current glob as a simple regex.

    Note: No interpolation is performed.

    Returns:
      A RegularExpression() object.
    """
        parts = _REGEX_SPLIT_PATTERN.split(self._value)
        result = u"".join(self._ReplaceRegExPart(p) for p in parts)

        return rdf_standard.RegularExpression(u"(?i)\\A%s\\Z" % result)
예제 #2
0
 def _RegexMatcher(string):
   regex = rdf_standard.RegularExpression(string)
   return conditions.RegexMatcher(regex)