def apply_bids_label_restrictions(value):
    """Sanitize file names for BIDS.
    """
    if value is None:
        return None
    from six import string_types
    if not isinstance(value, string_types):
        value = str(value)
    import re
    pattern = re.compile('[\\W_]+')
    return pattern.sub('', value)
