code: def validate(self, data):
          
          e = self._error
  
          try:
              if self._pattern.search(data):
                  return data
              else:
                  raise SchemaError("%r does not match %r" % (self, data), e)
          except TypeError:
              raise SchemaError("%r is not string nor buffer" % data, e)
docs: Validated data using defined regex.
          :param data: data to be validated
          :return: return validated data.