asp:RegularExpressionValidator

G

Guest

Im using the <asp:RegularExpressionValidator/> server control to validate an
email address
The problem i'm having is that some of the charecters in the expression seem
to be causing a problem (<> for example) which obviously start and close
tags.
The error message i'm getting is

Parser Error Message: The server tag is not well formed.

The validation expression i'm using is below.

validationexpression="/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)
|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-
0-9]+\.)+[a-zA-Z]{2,}))$/"
 
J

Jose Marcenaro

¿Has probado reemplazar así?:
">" por &gt;
"<" por &lt;

Saludos
Jose.
Im using the <asp:RegularExpressionValidator/> server control to validate an
email address
The problem i'm having is that some of the charecters in the expression seem
to be causing a problem (<> for example) which obviously start and close
tags.
The error message i'm getting is

Parser Error Message: The server tag is not well formed.

The validation expression i'm using is below.

|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-
0-9]+\.)+[a-zA-Z]{2,}))$/"
 
J

Jose Marcenaro

Ops - sorry for the spanish answer
My suggestion was to replace those characters (>,<) for their equivalent
form &gt; &lt;

NOTE: do not escape with \ any special character in &gt; or &lt; because
there are evaluated and replaced before the regexp get parsed.

Regards
Jose.

Im using the <asp:RegularExpressionValidator/> server control to validate an
email address
The problem i'm having is that some of the charecters in the expression seem
to be causing a problem (<> for example) which obviously start and close
tags.
The error message i'm getting is

Parser Error Message: The server tag is not well formed.

The validation expression i'm using is below.

|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-
0-9]+\.)+[a-zA-Z]{2,}))$/"
 

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

Top