c# - Regex get error in textbox when having space at the end -


I am using the following regex to verify the numbers which are working properly.
The problem is that if you enter the text box press a few valid numbers and then space , the expression is no longer valid.
How do I ignore the empty space at the end of the value entered by regex handling?

  @ "^ [0-9] + $"    

  @ "^ [0-9] + \s * $"   

In this way, you can take the position of zero or more at the end.

* is a quantifier for this particular purpose

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -