import re


def string_is_valid(
        string_to_check: str,
        allowed_characters: str):
    """
    - Checks if a string contains only characters that are present in
      allowed_characters.
    - Regex is used for the check.

    :param string_to_check: String that will be checked;
    :param allowed_characters: Regex expression that contains the allowed
                               characters;

    :return: - True if string_to_check has only allowed characters;
             - False otherwise.
    """

    not_allowed_characters = re.sub(allowed_characters, '', string_to_check)

    return not_allowed_characters == '' and string_to_check != ''