Python String replace based on chars NOT in RegEx,"re.sub('[^a-zA-Z0-9]', '_', filename)"