Beispiel #1
0
 def __new__(cls, pattern):
     """
     If the pattern is completely static (no wildcards are present) a
     L{BytePattern} is created instead. That's because searching for a
     fixed byte pattern is faster than searching for a regular expression.
     """
     if '?' not in pattern:
         return BytePattern(HexInput.hexadecimal(pattern))
     return object.__new__(cls, pattern)
Beispiel #2
0
 def __new__(cls, pattern):
     """
     If the pattern is completely static (no wildcards are present) a
     L{BytePattern} is created instead. That's because searching for a
     fixed byte pattern is faster than searching for a regular expression.
     """
     if '?' not in pattern:
         return BytePattern( HexInput.hexadecimal(pattern) )
     return object.__new__(cls, pattern)