import re


def get_sub_formula(formula):
    """
    "(SO3)2" -> ("(SO3)2", "(SO3)", "2")
    "(SO3)" -> ("(SO3)", "(SO3)", "")

    """

    match = re.search('(\([a-zA-Z\d]+\))(\d*)', formula)
    if not match:
        return

    full_sub_formula = match.group(0)
    sub_formula = match.group(1)
    multiplier = match.group(2)

    return full_sub_formula, sub_formula, multiplier