import re example_str = "Here is a example number: 1234. Here is another: 5678" number = re.findall("d+", example_str) # Get list of numbers in string # d+ -> matches 1 or more (+) digits appearances in string