Esempio n. 1
0
File: paths.py Progetto: wprelic/grr
    def AsRegEx(self):
        """Return the current glob as a simple regex.

    Note: No interpolation is performed.

    Returns:
      A RegularExpression() object.
    """
        return rdf_standard.RegularExpression("(?i)^" +
                                              fnmatch.translate(self._value))
Esempio n. 2
0
File: paths.py Progetto: binsrc/grr
    def AsRegEx(self):
        """Return the current glob as a simple regex.

    Note: No interpolation is performed.

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

        return rdf_standard.RegularExpression("(?i)\\A%s\\Z" % result)
Esempio n. 3
0
 def _RegexMatcher(string):
   regex = rdf_standard.RegularExpression(string)
   return conditions.RegexMatcher(regex)
Esempio n. 4
0
 def _RegexMatcher(string):
   regex = rdf_standard.RegularExpression(string)
   return client_file_finder.RegexMatcher(regex)