Answers for "python regex keep only numbers"

2

python strip non numeric in string

>>> import re
>>> re.sub("[^0-9]", "", "sdkjh987978asd098as0980a98sd")
'987978098098098'
Posted by: Guest on September-28-2020
2

python regex numbers only

import re
re.compile(r'[/d]+') 
# /d refers to any digit
# use other regex patters for ore modifcations
# This can extract the numbers from the regex
Posted by: Guest on February-16-2021

Code answers related to "python regex keep only numbers"

Python Answers by Framework

Browse Popular Code Answers by Language