It's in an XML file, so you need to use XML escaping, not C/Java escaping.
  (*Chris*)

On Wed, Mar 31, 2010 at 8:41 AM, seeking_solution <pankajj.j...@gmail.com>wrote:

>
> In struts I have regular expression for validating email like this -
> <constant>
>          <constant-name>EMail</constant-name>
>
>
> <constant-value>^([a-zA-Z0-9]([\w\.-]*[a-zA-Z0-9])*[...@[a-za-z0-9]([\w\.-]*[a-zA-Z0-9])*\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])[\s]*$</constant-value>
> </constant>
>
> Now I want to allow & in the email. I tried like this
>
>
> <constant-value>^([a-zA-Z0-9&]([\w\.-]*[a-zA-Z0-9&])*[...@[a-za-z0-9]([\w\.-]*[a-zA-Z0-9])*\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])[\s]*$</constant-value>
>
> OR
>
>
> <constant-value>^([a-zA-Z0-9]([\w\.-]*[a-zA-Z0-9])*[...@[a-za-z0-9]([\w\.-&]*[a-zA-Z0-9])*\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])[\s]*$</constant-value>
>
> I also tried escaping special char using \&.
>
> But its not working. gives error at deploy time.
>
> Please help
>
> --
> View this message in context:
> http://old.nabble.com/Regular-expressions---Email-Validation-tp28097766p28097766.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to