import re


def get_sequence_pattern_and_padding(file):
    """ Return sequence pattern and padding from file

    Attributes:
        file (string): basename form path

    Example:
        Can find file.0001.ext, file.%02d.ext, file.####.ext

    Return:
        string: any matching sequence pattern
        int: padding of sequnce numbering
    """
    foundall = re.findall(
        r"(#+)|(%\d+d)|(?<=[^a-zA-Z0-9])(\d+)(?=\.\w+$)", file)
    if foundall:
        found = sorted(list(set(foundall[0])))[-1]

        if "%" in found:
            padding = int(re.findall(r"\d+", found)[-1])
        else:
            padding = len(found)

        return found, padding
    else:
        return None, None