Posted on: 1/23/2014 3:28:57 AM | Views : 432

Hello everyone, I would like to write a regular expresion validator for the following:
Valid: 1.5, 1, 2, 2.0, 2, 1.0, 0.50, .50, .5
Invalid: all letters, 1.3, 1., 1.2, 
So I would like to allow only number and .5 after the decimal point. 
I got this regular expression: 
<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="textbox1" CssClass="validator" ErrorMessage="" ValidationExpression="^([1-9]\d*)(?:\.[05]0?)?$" SetFocusOnError="True" ValidationGroup="test"></asp:RegularExpressionValidator> But it makes 0.5 invalid also. 

Thanks for your help. 


Go to the complete details ...