What does this ValidationExpression means?

sha_shivani

Member
Joined
Sep 28, 2006
Messages
11
Programming Experience
1-3
What does this ValidationExpression means?


<asp:RegularExpressionValidator id="revInvestor" runat="server" ControlToValidate="ddlInvestor" ValidationExpression="\d{1,10}"><-</asp:RegularExpressionValidator>
 
It validates the ddlInvestor control on the web page against this pattern "\d{1,10}"

What that pattern does exactly, I'm not sure.
 
\d means digit 0-9
{n, m} repeats the previous item between n and m times (inclusive).

Putting them together means that it's looking for a digit repeating between 1 and 10 times. This is the greedy form so it will look for a digit repeating 10 times first and work backwards.
 
Back
Top