You can insure that the numbers are between 0 and 255 with a regex, but I highly recommend against it. An easier method here is to capture the numbers with a regex and check that they are between 0 and 255 by simply casting to an int and comparing:
>>> import re
>>> r = r"(\d+),\s*(\d+),\s*(\d+)"
>>> re.match(r, "0, 254,10").groups()
('0', '254', '10')
>>> all(0 <= int(group) <= 255 for group in re.match(r, "0, 254,10").groups())
True
>>> all(0 <= int(group) <= 255 for group in re.match(r, "0,256, 190").groups())
False