Regular Expression Validator seems to be wrong!

Discussion in 'ASP .Net' started by Edward, Dec 4, 2003.

  1. Edward

    Edward Guest

    I have the following control on my page:

    <asp:regularexpressionvalidator id="RegularExpressionValidator1"
    style="Z-INDEX: 104; LEFT: 355px; POSITION: absolute; TOP: 28px"
    runat="server" Width="131px" Height="10px" ErrorMessage="The Postcode
    is not in the correct format" ValidationExpression="
    ^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?
    {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$"
    ControlToValidate="txtPostCode"></asp:regularexpressionvalidator>

    The Validation Expression comes from here:

    http://www.regexlib.com/RETester.aspx?regexp_id=260

    If I enter a valid postcode in regexlib's tester, I get a match.

    If I enter a valid postcode in "txtPostCode", I get an error message.

    Help!

    Edward
    --
    The reading group's reading group:
    http://www.bookgroup.org.uk
     
    Edward, Dec 4, 2003
    #1
    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,343
    Brian Vallelunga
    Jul 31, 2003
  2. VSK
    Replies:
    2
    Views:
    2,357
  3. Bryce Budd

    Regular Expression Validator

    Bryce Budd, Sep 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    587
    Brian Davis
    Sep 18, 2003
  4. Simple Simon
    Replies:
    2
    Views:
    4,381
    Simple Simon
    Nov 4, 2003
  5. CarlosRivera
    Replies:
    2
    Views:
    99
    CarlosRivera
    Sep 21, 2004
Loading...

Share This Page