asp:RegularExpressionValidator

  • Thread starter Thread starter Guest
  • Start date Start date
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,}))$/"
 
¿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,}))$/"
 
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,}))$/"
 
Back
Top