Regex to check a decimal values in

Posted by Ranjeet_8 under VB.NET category on | Points: 40 | Views : 1645
check a decimal values

Dim regex As New Regex("^[-+]?[0-9]*\.?[0-9]+$")
Dim DecVal As Decimal = 123.99
If regex.IsMatch(DecVal) Then
Response.Write("Correct Number")
Response.Write("Incorrect Number")
End If

Comments or Responses

Posted by: Naraayanan on: 5/15/2013 Level:Starter | Status: [Member] | Points: 10
Hi Ranjeet,
Please check your Code.
Please set Decimal Value 123. Result shows Correct Number. But I didn't add Decimal value .So Please test before update the Code,

Login to post response