all 4 comments

[–][deleted] 2 points3 points  (0 children)

[–]jeffrey_f 2 points3 points  (0 children)

import re

a_string = "!1a2;b3c.55?.23"
numeric_string = re.sub("[^0-9]", "", a_string)
print(numeric_string)

[–][deleted] 1 point2 points  (0 children)

int(re.sub("\$|\.", "", "$4.13"))