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

Smith
Smith
Participant
360 Points
110 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: 8137
Total Answered: 1
Total Marked As Answer: 0
Posted On: 18-May-2016 00:38

Share:   fb twitter linkedin
Answers
Mayank
Mayank
Member
78 Points
24 Posts
     

Hi,

try following regex as

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

Blog

Active User (2)

 Log In to Chat