import re


def select(ds, *tags):
    """
    Reads the given DICOM dataset tags.
    
    :param ds: the pydicom dicom object
    :param tags: the names of tags to read (default all unbracketed tags)
    :return: the tag name => value dictionary
    """
    if not tags:
        # Skip tags with a bracketed name.
        tags = (de.name for de in ds if de.name and de.name[0] != '[')
    tdict = {}
    for t in tags:
        try:
            # The tag attribute.
            attr = re.sub('\W', '', t)
            # Collect the tag value.
            tdict[t] = getattr(ds, attr)
        except AttributeError:
            pass

    return tdict