Make sure you know only none or one string will be matched! If you are not sure, use `match_one_pattern` instead.

    :param pattern:
    :param s:
    :param args:
    :return:

    .. doctest::

        >>> p = "\d+"
        >>> s = "abc 123 def"
        >>> match_one_string(p, s, int)
        123
        >>> print(match_one_string(p, "abc"))
        Pattern "\d+" not found, or more than one found in string abc!
        None
        >>> print(match_one_string(p, "abc 123 def 456"))
        Pattern "\d+" not found, or more than one found in string abc 123 def 456!
        None

def match_one_string(pattern: str, s: str, *args):
    """
    Make sure you know only none or one string will be matched! If you are not sure, use `match_one_pattern` instead.

    :param pattern:
    :param s:
    :param args:
    :return:

    .. doctest::

        >>> p = "\d+"
        >>> s = "abc 123 def"
        >>> match_one_string(p, s, int)
        123
        >>> print(match_one_string(p, "abc"))
        Pattern "\d+" not found, or more than one found in string abc!
        None
        >>> print(match_one_string(p, "abc 123 def 456"))
        Pattern "\d+" not found, or more than one found in string abc 123 def 456!
        None
    """
    try:
        # `match` is either an empty list or a list of string.
        match, = re.findall(pattern, s)
        if len(args) == 0:  # If no wrapper argument is given, return directly the matched string
            return match
        elif len(args) == 1:  # If wrapper argument is given, i.e., not empty, then apply wrapper to the match
            wrapper, = args
            return wrapper(match)
        else:
            raise TypeError(
                'Multiple wrappers are given! Only one should be given!')
    except ValueError:
        print("Pattern \"{0}\" not found, or more than one found in string {1}!".format(
            pattern, s))