How do we remove all non-numeric characters from a string in Python?
>>> import re >>> re.sub("[^0-9]", "", "sdkjh987978asd098as0980a98sd") '987978098098098'
2.1m questions
2.1m answers
60 comments
57.0k users