([1-9]|1[0-9]|2[0-4])(,([1-9]|1[0-9]|2[0-4]))*[
^]
To break it down...
[1-9]|1[0-9]|2[0-4] This block is representing a numeric range from 1 to 24...Consider that regex is working with text, with character and know nothing of numbers, so you have to create character map that behaves like a numeric filter...
The second part is actually the same, but there is a preceding comma to separate the numbers...