import re


def _parse_mod_string(s):
    """Parses a string referring to a protein modification of the form
    (residue)(position), such as T47.

    Parameters
    ----------
    s : str
        A string representation of a protein residue and position being
        modified

    Returns
    -------
    residue : str
        The residue being modified (example: T)
    position : str
        The position at which the modification is happening (example: 47)
    """
    m = re.match('([A-Za-z])+([0-9]+)', s)
    assert(m is not None)
    return (m.group(1), m.group(2))