I have wrote regular expression to accept following type of versions
An example: "4.2.2+", "4.3.*, "4.2+"
/^([0-9])\.([0-9]+[*]{0,1}[+]?)(?:\.([0-9]+[*]{0,1}[+]?))?$/
It is accepting above all type but also accepting "4.2+.0" which should be invalid. How can I avoid this "4.2+.0" scenario.
Can anyone provide me regex to validate above versions?
Please use following regex for validating version /^\d+((?:.\d+([+]$){0,1})|(.[*]{1,1})){1,2}$/
^ Start of string \d+ Match 1+ digits