Monday, April 1, 2013

Java Script ReGex to allows string with comma, semicolon and digits only

var regexPattern = /^\d*[0-9]([\;|\,]\d*[0-9])*?$/;

if(!regexPattern.test(value)) {


alert("Invalid String value."); return;


} else 
{

          alert(" Valid String ");

}

No comments:

Post a Comment