Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > regular expression validator

Reply
Thread Tools

regular expression validator

 
 
niju
Guest
Posts: n/a
 
      07-08-2005
Hi
I have a text box which takes either 8 or 10 digit number. I am using a
regular expression valuator to validate the text box. I also want to be
able to remove any white space from the text box. Is there a way to do
this with in the regular expression valuator? Any help would be greatly
appreciated.

Here is my Regex : (02)?[4,8,9]{1}[0-9]{3}[0-9]{4}

for example (99 99 9999) should be (99999999) and validated against
(02)?[4,8,9]{1}[0-9]{3}[0-9]{4}


many Thanks
niju

 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      07-08-2005
niju wrote:
> Hi
> I have a text box which takes either 8 or 10 digit number. I am using
> a regular expression valuator to validate the text box. I also want
> to be able to remove any white space from the text box. Is there a
> way to do this with in the regular expression valuator? Any help
> would be greatly appreciated.
>
> Here is my Regex : (02)?[4,8,9]{1}[0-9]{3}[0-9]{4}
>
> for example (99 99 9999) should be (99999999) and validated against
> (02)?[4,8,9]{1}[0-9]{3}[0-9]{4}
>
>
> many Thanks
> niju


to test RE's, look for programs as "The Regulator" and "The Regex Coach"

If the spaces are at expected places, you can extend your RE:
(02)?[4,8,9]{1}[ ]?[0-9]{3}[ ]?[0-9]{4}

Hans Kesting





 
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