>>> import re
>>> re.sub("[^0-9]", "", "sdkjh987978asd098as0980a98sd")
'987978098098098'
More Related Contents:
- How to add numbers inside a variable? [closed]
- How to generate random binary numbers 0 or 1 with length of N and with option to control the probability of having 0 or 1?
- Is there a way to ordinate numbers in a list?
- How to extract numbers from a string in Python?
- How to format a floating number to fixed width in Python
- Is there a way to convert number words to Integers?
- Python math is wrong [duplicate]
- python re.sub group: number after \number
- Why doesn’t this division work in Python? [duplicate]
- Grouping / clustering numbers in Python
- What is the most pythonic way to check if an object is a number?
- How to generate random numbers that are different? [duplicate]
- Checking odd/even numbers and changing outputs on number size
- How can I check if my python object is a number? [duplicate]
- Find the greatest number in a list of numbers
- How do you check in python whether a string contains only numbers?
- Loop until a specific user input [duplicate]
- Python floating-point math is wrong [duplicate]
- Generating non-repeating random numbers in Python
- Python: Number of the Week in a Month
- Python – Regular expressions get numbers between parenthesis
- How to convert a negative number to positive?
- Turn a single number into single digits Python [duplicate]
- Parse currency into numbers in Python
- Find the greatest (largest, maximum) number in a list of numbers
- Does “\d” in regex mean a digit?
- How to display custom values on a bar plot
- getting the index of a row in a pandas apply function
- Selenium Unable to locate element only when using headless chrome (Python)
- Convert Pandas Series to DateTime in a DataFrame