Regular Expression Validator seems to be wrong!

E

Edward

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
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,191
Latest member
BuyKetoBeez

Latest Threads

Top