python strip non numeric characters from string code example
Example 1: python strip non numeric in string
>>> import re
>>> re.sub("[^0-9]", "", "sdkjh987978asd098as0980a98sd")
'987978098098098'
Example 2: python remove non letters from string
def nospecial(text):
import re
text = re.sub("[^a-zA-Z0-9]+", "",text)
return text