import re
import warnings
import random


def get_first_number(my_string: str):
    """
    get_first_number - return the first number found in a string with regex as an integer

    Parameters
    ----------
    my_string : str, required, input

    Returns
    -------
    int, first number found in the string
    """
    search = re.search(r"\d+", my_string)
    if search is None:
        warnings.warn(
            "No number found in string: {}, returning random".format(my_string)
        )
        return random.randint(0, 10**8)
    else:
        return int(search.group(0))