Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > quick help needed on regular expression validator

Reply
Thread Tools

quick help needed on regular expression validator

 
 
David Cho
Guest
Posts: n/a
 
      02-14-2005
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!
 
Reply With Quote
 
 
 
 
Wilco Bauwer
Guest
Posts: n/a
 
      02-14-2005
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.

 
Reply With Quote
 
 
 
 
John Timney \(ASP.NET MVP\)
Guest
Posts: n/a
 
      02-14-2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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!



 
Reply With Quote
 
David Cho
Guest
Posts: n/a
 
      02-15-2005
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!
 
Reply With Quote
 
David Cho
Guest
Posts: n/a
 
      02-15-2005

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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Validator seems to be wrong! Edward ASP .Net 0 12-04-2003 05:31 PM
P.O. Box Regular Expression Validator - heeeeeelp? Simple Simon ASP .Net 2 11-04-2003 05:10 PM
Regular Expression Validator Bryce Budd ASP .Net 1 09-18-2003 05:51 PM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM
Re: howto use c# regular expression validator to exclude file types Brian Vallelunga ASP .Net 2 07-31-2003 10:27 PM



Advertisments