import re


def replaceSharpWithPadding(string, index):
    """Replace a list of # symbol with properly padded index.

    ie. count_### > count_001

    :param string string: A string to set. Should include '#'
    :param integer index: Index to replace.
    :return string: Normalized string.

    """
    if string.count("#") == 0:
        string += "#"

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

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