import re


def get_url_from_string(text):
    """Return the first url within a string"""
    url_pattern = re.compile(r"(?P<url>https?://[^\s]+)")
    result = re.search(url_pattern, text)
    if result:
        return result.group("url")