public boolean isNumeric(String s)
    {
        Pattern pattern = Pattern.compile("[0-9]*");
        Matcher matcher = pattern.matcher(s);
        return matcher.matches();
    } 


function isNumeric(value){
    	var returnValue = true;
		var re =  new RegExp("^([0-9]+)$");
		if(value.search(re) == -1)
		{
	   	returnValue=false;
		}
		return returnValue;
	}
评论
发表评论

您还没有登录,请登录后发表评论