How can i validate a textbox where input should be in two specified formats..The formats are
For example: 1-5 or 1 2 3 4 5
See i want to enter the numbers (numbers only) in above two ways only.Either like 1-5(no spaces in between) or like 1 2 3 4 5(only one space in between).How can i validate and avoid the entries except in these two formats using regular expressions?
Please help
The above regex should match your requirements
Of course, this is javascript!
To validate: