remove all characters that aren't integers string python code example
Example 1: python remove all except numbers
>>> import re
>>> re.sub('\D', '', 'aas30dsa20')
'3020'
Example 2: remove alphabetic characters python
numeric_answer = filter(str.isdigit, original_string)
numeric_answer = "".join(numeric_answer)