regular expression validator

N

niju

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
 
H

Hans Kesting

niju said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top