import re


def extract_subkeys(d, base):
    """Extract items from a dictionary with keys starting with a given string.

    >>> d = {'xxx_yyy': 1, 'xyz': 'abc'}
    >>> extract_subkeys(d, 'xxx_')
    {'yyy': 1}
    
    """
    subkeys = {}
    for key, val in d.items():
        match = re.match('%s(?P<subkey>\w+)' % base, key)
        if match:
            subkeys[match.group('subkey')] = val
    return subkeys