473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

RegularExpression?

Using RegularExpression, I want to validate a TextBox so that the
TextBox accepts only 8-digit numbers. This can be done with the
following RegularExpression:

[0-9]{8}

But how do I validate the TextBox so that it accepts 8-digit number or
more than 8-digit numbers using RegularExpressions?

Also how do I validate the TextBox so that it accepts 8 or more than
8-digit numbers but less than or equal to 10-digit numbers using
RegularExpressions? I tried this but it didn't work:

([0-9]{8})|([0-9]{9})|([0-9]{10})

The above RegEx accepts only 8-digit numbers, not 9 & 10-digit numbers.

Thanks,

Arpan

Aug 27 '06 #1
1 1512
Please neglect this post.

Thanks,

Arpan

Arpan wrote:
Using RegularExpression, I want to validate a TextBox so that the
TextBox accepts only 8-digit numbers. This can be done with the
following RegularExpression:

[0-9]{8}

But how do I validate the TextBox so that it accepts 8-digit number or
more than 8-digit numbers using RegularExpressions?

Also how do I validate the TextBox so that it accepts 8 or more than
8-digit numbers but less than or equal to 10-digit numbers using
RegularExpressions? I tried this but it didn't work:

([0-9]{8})|([0-9]{9})|([0-9]{10})

The above RegEx accepts only 8-digit numbers, not 9 & 10-digit numbers.

Thanks,

Arpan
Aug 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Edwin G. Castro | last post by:
Hi, I'm new to XSLT and I'm having a hard time figuring out whether XSLT will do what I need it to do. I have a XML file with a whole bunch of <message> elements. These <message> elements...
1
by: mg | last post by:
Does someone have RegularExpression code (C# WebForm) for server-side validation of Date (mm/dd/yyyy) ... including leap year?
2
by: John Hoge | last post by:
I have a regex "^\d{5}$" that does not allow blanks, but the RegularExpressionValidator does not fire for empty fields. Is there a way to make it do so? I would rather not include a separate...
1
by: fabrice | last post by:
Hello, In a search form, i want to permit few characters (see below) and some signs as - _ / , . So thios my RegularExpression and it works. ValidationExpression="{4,20}" But i'd would...
1
by: Nicola Farina | last post by:
Hi all, i've a form with a textbox that user "must" fill with a password. I want to check if there's a password inside, and if it's between 6 an 8 chars. I've placed a regularexpression...
2
by: Fabio | last post by:
Hi all, I have this simple string for example: anything<font>catch this</font> and I need a regularexpression to Catch "catch this" so, I can use this pattern: ">+"
2
by: den 2005 | last post by:
Hi everybody, How do restrict entering these characters <>\"%';()& and telling user these caharcters are not allowed to be enter in the textbox field using RegularExpression Validator? I put in...
3
by: Arpan | last post by:
Consider the following code which validates a TextBox using RegularExpression: <form id="form1" runat="server"> <asp:TextBox id="txt1" runat="server"/> <asp:RegularExpressionValidator...
1
by: prp | last post by:
hi all, I have a problem.Suppose I use a regularexpression validator for zip code. An User fill wrong entry in the relevant textbox then regularexpression validator fires.but user did not...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.