def __init__(self, string_type=unicode, default=None):
    """Initialized regex validator.

    Raises:
      AttributeDefinitionError if string_type is not a kind of string.
    """
    if default is not None:
      default = _RegexStrValue(self, default)
      re.compile(str(default))
    super(RegexStr, self).__init__(default)
    if (not issubclass(string_type, basestring) or
        string_type is basestring):
      raise AttributeDefinitionError(
          'RegexStr fields must be a string type not %s.' % str(string_type))

    self.expected_type = string_type
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/api/validation.py/RegexStr.__init__/original