import re


def _alphanum_key(string):
    """Parse a string into string and integer components."""
    parity = int(string[0] in '0123456789')
    return [
        int(x) if i % 2 != parity else x
        for i, x in enumerate(re.split('([0-9]+)', string)[parity:])
    ]