Regex for validation
<p>Hi can anyone tell me how to write a regex for the following scenario. The input should only be numbers or -(hyphen) or ,(comma). The input can be given as any of the following</p>

<p>23</p>

<p>23,26</p>

<p>1-23</p>

<p>1-23,24
24,25-56,58-40,45</p>

<p>Also when numbers is given in a range, the second number should be greater than the first one. 23-1 should not be allowed. If a number is already entered it should not be allowed again. Like 1-23,23 should not be allowed</p>

<p>Thanks in advance</p>
