javascript - How to allow space in numeric regular expression? -
I want to validate the 'int' field with javascript regular expression.
I am using this RE string
var number = / ^ [0- 9] + $ / / This expression does not allow spaces in the text box.
How can I create a regular expression that allows spaces in the text box?
Add an optional location with:
var number = / ^ \ S * [0- 9] + \ s * $ /;
Comments
Post a Comment