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 -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -