import re


def is_url(value):
    """Return whether or not given value is a valid URL."""

    regex = re.compile(
        r"^"
        # startchar <
        r"<?"
        # protocol identifier
        r"(?:(?:https?|ftp)://)"
        r"(?:"
        r"(localhost)"
        r"|"
        # host name
        r"(?:(?:[a-z\u00a1-\uffff0-9]-?)*[a-z\u00a1-\uffff0-9]+)"
        # domain name
        r"(?:\.(?:[a-z\u00a1-\uffff0-9]-?)*[a-z\u00a1-\uffff0-9]+)*"
        # TLD identifier
        r"(?:\.(?:[a-z\u00a1-\uffff]{2,}))"
        r")"
        # port number
        r"(?::\d{2,5})?"
        # resource path
        r"(?:/\S*)?"
        # query string
        r"(?:\?\S*)?"
        # endchar >
        r">?"
        r"$",
        re.UNICODE | re.IGNORECASE
    )
    return regex.match(value)