import re

text = """cakes 10 are good.
cakes 10c are good.
cakes 20 21 22 are good.
cakes 30, 31, 32 are good.
cakes 40a, 40b, 40c are good."""

numerical = r"""\b[0-9]{1,4}(?:[.-]?[A-Za-z])?"""

# those could be separated by:
separator = r""",?\s"""

# code to get the matches with finditer
pattern2 = fr"""{numerical}(?:{separator}{numerical})*"""

refs = re.finditer(pattern2, text, re.VERBOSE)
for element in refs:
    print(element.group())