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

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -