0

I want a text field that accept numeric values OR just spaces and not number WITH space. What is the regular expression for this. Please help... Thanks in advance.

eg: valid = '456631', '' , ' ' AND '123 1232' = invalid

CodingOwl
  • 156
  • 1
  • 11
  • Not sure you made it much clearer - "numeric value with spaces and not number WITH space"? – SamWhan May 20 '16 at 12:23
  • Well, hit the wrong link :) Really, was not going to reopen the question. Still consider it a dupe of [Regex for field that allows numbers and spaces](http://stackoverflow.com/questions/13973206/regex-for-field-that-allows-numbers-and-spaces) – Wiktor Stribiżew May 23 '16 at 07:52

1 Answers1

2

use following regex :

^[\d ]+$
Rohit Goyani
  • 1,246
  • 11
  • 26