Extract Number Array - from Range (1, 2, 4-9, 20-31)

I am trying to create an array which will contain numbers from 01-99 but based upon a range which a user can enter - for example “1,2,3, 5-12, 34-45”, similar to when you print large numbers of pages off from word, etc…

I have thought about building a massive radio button tick box form, but this seems over the top?

If anyone has any experience of this previously, I would be very grateful.

Malc.