473,401 Members | 2,139 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,401 software developers and data experts.

quick help needed on regular expression validator

I am looking to use the input in the text box in the IN SQL clause (for
example, "WHERE studentID in (233, 3422, 43232)")

So I need the validator to validate

number, number, number, number

So acceptable
343435, 2232, 333, 3434

Not acceptable
- ,343,3434,3434, (nos comma before the string and after)
- r54, e3233 (alphas mixed in)
- 3232|12121|2232 (wrong delimiter)

Thank you very much. I plan on studying regular expressions soon, but
this is pretty urgent.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
8 1026
Try something like: "\(\d+(,\s*\d+)*\)"

Basically it means:
- Match a literal '('
- Match a digit (\d), once or more (+)
- Match a comma, 0 or more (*) spaces followed by at least (+) 1 digit
(\d) - Match this 0 or more times.
- Match a literal ')'

HTH.

Nov 19 '05 #2
Try something like: "\(\d+(,\s*\d+)*\)"

Basically it means:
- Match a literal '('
- Match a digit (\d), once or more (+)
- Match a comma, 0 or more (*) spaces followed by at least (+) 1 digit
(\d) - Match this 0 or more times.
- Match a literal ')'

HTH.

Nov 19 '05 #3
343435, 2232, 333, 3434

Not being very good at them myself I'll take a guess
at.........."[0-9],[0-9],[0-9],[0-9]" - which should give you four numeric
ranges from 0 through 9 seprated by commasor being very specific
...........(another guess)...........individual pattern of specific digits

"\d\d\d\d\d\d,\d\d\d\d,\d\d\d,\d\d\d";

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"David Cho" <pr********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am looking to use the input in the text box in the IN SQL clause (for
example, "WHERE studentID in (233, 3422, 43232)")

So I need the validator to validate

number, number, number, number

So acceptable
343435, 2232, 333, 3434

Not acceptable
- ,343,3434,3434, (nos comma before the string and after)
- r54, e3233 (alphas mixed in)
- 3232|12121|2232 (wrong delimiter)

Thank you very much. I plan on studying regular expressions soon, but
this is pretty urgent.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #4
343435, 2232, 333, 3434

Not being very good at them myself I'll take a guess
at.........."[0-9],[0-9],[0-9],[0-9]" - which should give you four numeric
ranges from 0 through 9 seprated by commasor being very specific
...........(another guess)...........individual pattern of specific digits

"\d\d\d\d\d\d,\d\d\d\d,\d\d\d,\d\d\d";

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"David Cho" <pr********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am looking to use the input in the text box in the IN SQL clause (for
example, "WHERE studentID in (233, 3422, 43232)")

So I need the validator to validate

number, number, number, number

So acceptable
343435, 2232, 333, 3434

Not acceptable
- ,343,3434,3434, (nos comma before the string and after)
- r54, e3233 (alphas mixed in)
- 3232|12121|2232 (wrong delimiter)

Thank you very much. I plan on studying regular expressions soon, but
this is pretty urgent.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #5
I would like to get it to work without the beggning and ending
paranthesis. I can't figure it out.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #6
I would like to get it to work without the beggning and ending
paranthesis. I can't figure it out.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #7

Is there a way to ignore carriage returns?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #8

Is there a way to ignore carriage returns?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #9

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

Similar topics

2
by: Bryce Budd | last post by:
Hi all, I am trying to use a regular expression validator to check for the existence of PO Box in an address textbox. The business rule is "No addresses with PO Boxes are allowed." What I...
3
by: Mark | last post by:
To validate the length of a multiline textbox, I'm told that I have to use a regular expression validator. The regular expression below limits it to 25 characters in length, but if the user enters...
2
by: VSK | last post by:
Hi all, I have a .ascx file with dropdownbox (SSN, EmpName) textbox submit button regular expression validator( controltovalidate is the above textbox) Now i want to change the Regular...
2
by: Nazir | last post by:
Hi I'm using a regular expression validator, but if spaces are entered, it bypasses the validation! I'm using ^{5,100}$
2
by: S.Kartikeyan | last post by:
I have the following problem. I am using the follwing Regular Expression validator(REV) with validator expressions ^{1,2}$ ^{3,20}$ The idea of the first exp is 1 or 2 digits the idea of second...
0
by: David Cho | last post by:
I am looking to use the input in the text box in the IN SQL clause (for example, "WHERE studentID in (233, 3422, 43232)") So I need the validator to validate number, number, number, number ...
5
by: John . | last post by:
I am using the Regular Expression Validator control to validate a correct email address. But, at the same time I would like to make it a required field. I tested by using just the regular...
2
by: kieran | last post by:
Hi, I am using Visual Studio 2005 and am trying to use a Regular Expression Validator control. I have a drop down list which contains various names, the first one is "Please Select". I want...
1
by: vtxr1300 | last post by:
I'm having a problem with a regular expression in conjunction with the regular expression validator. I am trying to make sure that when a user browses for a file to upload, it ends in gif, jpeg or...
2
by: Joey | last post by:
Hello guys, I'm trying to learn about regular expressions. I need to be able to use an RE that can evaluate for STRINGS (or specific sequences of characters), not just occurances of characters....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.