Skip to content

Instantly share code, notes, and snippets.

@biswarupadhikari
Created November 19, 2013 03:28
Show Gist options
  • Save biswarupadhikari/7539835 to your computer and use it in GitHub Desktop.
Save biswarupadhikari/7539835 to your computer and use it in GitHub Desktop.
Validate Version using Javascript
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