import re


def check_if_url(string: str) -> bool:
    """Checks if a string passed in is an URL.

    Args:
        string (str): string to check

    Returns:
        bool: True if it is, False otherwise
    """
    regex = re.compile(
        r"^(http://www\.|https://www\.|http://|https://)?[a-z0-9]+([\-.][a-z0-9]+)*\.["
        r"a-z]{2,5}(:[0-9]{1,5})?(/.*)?$")
    return re.match(regex, string) is not None