Regular expression for validating numbers only in javascript

The project can be found on Git Hub where you can also find our issue tracker.

There is also a Travis project used for testing, a Coveralls project used to code coverage as well as the annotated source.

By combining the expression for numbers and alphabetic characters, there is an expression that checks, whether the entered things includes numbers and alphabetic character or not.

The expression for matching numbers and characters in the field is: /^[0-9a-z A-Z] $/ It’s must to provide validation in the select field.

regular expression for validating numbers only in javascript-10regular expression for validating numbers only in javascript-45regular expression for validating numbers only in javascript-42

function text Alphanumeric(inputtext, alert Msg) // Function that checks whether the input characters are restricted according to defined by user.

The validation constraints can be declared in JSON and shared between clients and the server. One thing that is a bit unorthodox is that most validators will consider undefined values (,) valid values.

So for example adding a constraint of at least 6 characters will be like saying If the attribute is given it must be at least 6 characters.

[a-z] : It matches characters from lowercase ‘a’ to lowercase ‘z’. If by mistake, user skips entering any detail, soon the alert message appear on the form.

escaping - by -) [0-9] : It matches digital number from 0-9. That means, you could be very sure about the form, whether users have entered the details or not.