When asking a user to enter a mobile number, we usually validate if a number has 10 digits or not. If not, we ask user to enter full mobile number. In this case, I've a TextBox control on an ASP.NET Form. The following regular expression in ASPX file validates the number.
.ASPX File
  1. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br\>
  2. <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
  3. ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator"
  4. ValidationExpression="[0-9]{10}"></asp:RegularExpressionValidator>
Here are couple of detailed tutorials in regular expressions with code examples: