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
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br\>
- <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
- ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator"
- ValidationExpression="[0-9]{10}"></asp:RegularExpressionValidator>
Here are couple of detailed tutorials in regular expressions with code examples:


Former memberPosted Jun 11, 2019, 2:31 AM EDT
Thanks Sir...!
Vinay KeerthyPosted Mar 5, 2019, 2:28 AM EST
Thank u ....!
Aqeel EjazPosted Dec 18, 2017, 10:52 PM EST
Nice man..........!
pappu sharmaPosted Dec 5, 2016, 11:50 PM EST
Its col sir thanku very much
GokulPosted May 27, 2016, 1:14 AM EDT
thank you so much
mak kPosted Nov 5, 2015, 5:58 AM EST
Thank You ..
Vivek JoyPosted Aug 26, 2015, 9:49 PM EDT
Can u say what is the code in c#
Hari ShankerPosted Mar 18, 2015, 6:19 AM EDT
Thanx
muhammed shanidPosted Feb 5, 2015, 6:07 PM EST
thank you