I have a condition to validate a number. My requirement is accept only following numbers.
0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5
I tried with this regex but it returns false for decimal numbers.
/^[0|0.5|1|1.5|2|2.5|3|3.5|4|4.5|5]$/
The system that I am working is an existing system and I must use regular expression. No other option available for me.
Can anyone help me?