Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ..
i want a regular expression validator that contain the validation expression like.
1. there should be a range between 10 to 500
2. and all character, numerals, digits ,white space and all special character must be allowed .

there should not be any restriction user can put any thing any special character and digits but only in length which is given that is 10 to 500.
Posted
Comments
OriginalGriff 4-Oct-12 9:47am    
Good for you!
If you are waiting for permission, then consider it given.
If not, then what have you tried?
fjdiewornncalwe 4-Oct-12 10:08am    
Your logic doesn't make sense. How can you have a range of values if there are all these other characters included. If your initial logic isn't clear then there is no way that you will magically come up with a code solution.
amitkumar5734 5-Oct-12 3:21am    
<asp:RegularExpressionValidator ID="RegExp1" runat="server"
ErrorMessage="Password length must be between 7 to 10 characters"
ControlToValidate=" txtPassword "
ValidationExpression="^[a-zA-Z0-9'@&#.\s]{7,10}$" />

have a look mr. marcus kramer , according to requirement we have to do this.. we can set range in regular expression ,

1 solution

i would suggest use regular expressions like with regular expression validator,
C#
<asp:RegularExpressionValidator ID="RegExp1" runat="server"
ErrorMessage="Password length must be between 7 to 10 characters"
ControlToValidate=" txtPassword "
ValidationExpression="^[a-zA-Z0-9'@&#.\s]{7,10}$" />
 
Share this answer
 
Comments
amitkumar5734 5-Oct-12 3:22am    
thnks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900