I want to validate a text field to accept just text like this :
- 1,2;2,3;1-3
- 1-2;4;2,3;4;1-3
- 12
I don't want the types like this :
- ;1
- ,1
- -1
- 1;;2
- 1,,2
- 1--2
- 1-2-3
- 1,2,3
- 1,2-3
so I make this regular expression but it seems doesn't work like what I want
var reg = /^\d*(((?!.*--)(?!.*,,)(?!.*;;)(?!.*,;)(?!.*,-)(?!.*-;)(?!.*-,)(?!.*;,)(?!.*;-))[,-;])*\d$/
thanks for your help :)