Warning: the following code contains excessive use of regular expressions. Prolonged exposure may cause eye strain, headaches, and existential dread.
Use the following code to match any whole number:
import re
print(re.search(r'\d+', '12345')) # returns a match object
This will match any sequence of digits. Not exactly rocket science, but it's a good starting point.
Don't say we didn't warn you...