import re


def make_url_tags(line: str) -> str:
    """Find URLs in string and replace them with <a> tags."""
    return re.sub(
        r"""
            (
                (?:http://|https://|ftp://|mailto:|news:|irc:)
                [^\s<>()"]*?
                (?:\([^\s<>()"]*?\)[^\s<>()"]*?)*)
                ((?:\s|<|>|"|\.||\]|!|\?|,|&\#44;|&quot;)*
                (?:[\s<>()"]|$)
            )
        """,
        r'<a href="\1" rel="nofollow">\1</a>',
        line,
        flags=re.X
    )