"(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}(?<!-)\.?)|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[?[A-F0-9]*:[A-F0-9:]+\]?)(?::\d+)?(?::\d+)?(?:/", "?|[/?]\S+)$" and re.IGNORECASE, substitute the result for regex. call a function _ with a string 'Enter a valid value.' as an argument, substitute the result for message.
message = _ ( 'Enter a valid URL.' )