Created
November 19, 2013 03:28
-
-
Save biswarupadhikari/7539835 to your computer and use it in GitHub Desktop.
Validate Version using Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateVersion(version){ | |
var pat=/^[0-9]{1,3}.[0-9]{0,3}.[0-9]{0,3}$/; | |
return pat.test(version) | |
} | |
Validate Version | |
var version="10.2.5"; | |
if(validateVersion(version)){ | |
alert("Valid Version"); | |
}else{ | |
alert("Invalid Version"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment