Jan-03-2018, 03:04 PM
You can use regex substitute method to replace
illegal = ['NUL','\',''//',':','*','"','<','>','|'] for i in illegal: ctitle = ctitle.replace(i, '')
import re ctitle = re.sub(r'[\\/\:*"<>\|\.%\$\^&£]', '', ctitle)