Introduction
Here we have to discuss the Regular expression which decimal numbers like 125.00 , 254.25 Technologies:
Regular Expression
Language:
C# and VB.NET
Prerequisite
.NET Framework 2.0 Visual Studio 2005
Implementation
Regular expression Patten="^\d+\.\d{2}$"
Html Code {codecitation class="brush: html; gutter: true;" width="500px"}
<td> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="TextBox2" ValidationExpression="^\d+\.\d{2}$" runat="server" ErrorMessage="it should be 125.00 this format"></asp:RegularExpressionValidator> </td> {/codecitation} Match Case : Only numbers , Decimal numbers
Ex: 251.00 542.25
Non- Match:
12545 145.002 854.0 41
Thank you Venkat |