Regular Expressions (Regex) to allow both decimals as wells as integers in C#

Smith
Smith
None
2568 Points
74 Posts

I am trying to validate a number that may be decimal number decimal(19,2) or a integer value as 

  • 10
  • 10.1
  • 10.12
  • 0

I want to do with regex  in C#.

Thanks..

Views: 9187
Total Answered: 1
Total Marked As Answer: 0
Posted On: 18-May-2016 00:38

Share:   fb twitter linkedin
Answers
Mayank
Mayank
Member
194 Points
12 Posts
         

Hi,

try following regex as

\d+(\.\d{1,2})?
Posted On: 18-May-2016 00:44
 Log In to Chat