import re text = "There are 7 cats, 23 dogs, and 456 birds." pattern = r'\b\d{1,3}\b' matches = re.findall(pattern, text) print("Numbers found:", matches)