Regex for field that allows numbers and spaces

后端 未结 5 2035
南方客
南方客 2020-12-11 00:13

I want that the text field only accept numeric values and spaces. What is regular expression for this? I was trying with \\d+$ Thanks

5条回答
  •  遥遥无期
    2020-12-11 00:45

    ^ for the begining of string. [\d ]* for any combination of this symbols. $ for end of string.

    ^[\d ]*$

提交回复
热议问题