Skip to content

Instantly share code, notes, and snippets.

@bhaveshpraveen
Created June 2, 2017 07:32
Show Gist options
  • Save bhaveshpraveen/941b434ea3ca3679aab0bd6530d300c6 to your computer and use it in GitHub Desktop.
Save bhaveshpraveen/941b434ea3ca3679aab0bd6530d300c6 to your computer and use it in GitHub Desktop.
filter for excluding special characters
def func(i):
return re.sub('[,./<>?;\':"\[\]{}|`~\-_=+)(*&^%$#@!]', '', i)
words_list = [ '"he$ll/o' , 'this:' , 'i7' ]
words_list = list(map(func, words_list))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment