views:

92

answers:

1

I am having some trouble escaping a validation expression within a regular expression validator in XSLT.

<asp:RegularExpressionValidator ID="regValEmail" ErrorMessage="..." runat="server" ValidationGroup="Store"
     ValidationExpression="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?>" ControlToValidate="txtEmailTempSave">

I can't seem to get the characters ' and & escaped.

+3  A: 

Inside a XML document, you should to use:

&amp;  for &
&apos; for '
&quot; for "
&lt;   for <
&gt;   for >
Rubens Farias