import re pattern = '[a-zA-Z0-9]' input = 'asdf@$%aasdf..{}}.jpg' output = ''.join(re.findall(pattern, input))
Jump To Top of Thread