I need to validate if an input type is a number with some specifications using regex expressions. The number can have any number of commas(,) but not dots(.) but comma and dot should not be side by side such as
12,34,56,7.89 -- correct --- 1
12.34.56 -- wrong ---- 2
12345 -- correct ---- 3
123,45 -- correct ---- 4
123.45 -- correct --- 5
123,,45 -- wrong --- 6
12,345,678 -- correct --- 7
The expression I used is
((((\d+[.]?\d*)|(\d*[.]?\d+))[,]?)+\d+)
I am unable to solve test case 2 and 6. any help is acceptable thankyou