Computer >> Computer tutorials >  >> Programming >> Python

How to write a Python regular expression to get numbers except decimal?


The following code gets the numbers in the given string except the decimal

>>> m = re.match(r"(\d+)\.(\d+)", "80.3196")
>>> m.groups()
('80', '3196')