def validate(self, value, model=None, context=None):
value = str(value)<EOL>regex = self.regex(<EOL>protocols=self.protocols,<EOL>localhost=self.localhost<EOL>)<EOL>regex = re.compile(regex, flags=self.flags)<EOL>match = regex.match(value)<EOL>if not match:<EOL><INDENT>return Error(self.url_invalid)<EOL><DEDENT>return Error()<EOL>
Validate
Perform value validation and return result

:param value:           value to check
:param model:           parent model being validated
:param context:         object or None, validation context
:return:                shiftschema.results.SimpleResult