I have a text field that allows a user to enter their age. I am trying to do some client-side validation on this field with JavaScript. I have server-side validation already
var intRegex = /^\d+$/; if(intRegex.test(someNumber)) { alert('I am an int'); ... }
That will absolutely, positively fail if the user enters anything other than an nonnegative integer.