import re


def replace_sharps_with_padding(string, index):
    """Replaces # symbols on a string with properly padded indexing

    Args:
        string(str): String to operate on. Sould contain '#' characters
        index(int): Index value
    Returns:
        str: sIndexed string

    Example:
        count_### > count_001
    """

    # Adds end sharp character if none found
    if string.count("#") == 0:
        string += "#"

    digit = str(index)
    while len(digit) < string.count("#"):
        digit = "0" + digit

    return re.sub("#+", digit, string)