regular expression validator

Discussion in 'ASP .Net' started by niju, Jul 8, 2005.

  1. niju

    niju Guest

    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
     
    niju, Jul 8, 2005
    #1
    1. Advertising

  2. niju

    Hans Kesting Guest

    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
     
    Hans Kesting, Jul 8, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Vallelunga
    Replies:
    2
    Views:
    8,294
    Brian Vallelunga
    Jul 31, 2003
  2. VSK
    Replies:
    2
    Views:
    2,303
  3. Bryce Budd

    Regular Expression Validator

    Bryce Budd, Sep 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    576
    Brian Davis
    Sep 18, 2003
  4. Simple Simon
    Replies:
    2
    Views:
    4,347
    Simple Simon
    Nov 4, 2003
  5. Edward
    Replies:
    0
    Views:
    830
    Edward
    Dec 4, 2003
Loading...

Share This Page