This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 Regex Validation killing me, Please help

 
Prav Chau
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I am trying to use regex for normal string validation. Tried various regular expression but struts2 validation didn't work for me. In below example I am trying to validate string which will have only Capital letters A to Z. Can anyone help me to find correct regular expression for validating string with special characters.

<field name="regexValidatorField">
<field-validator type="regex">
<param name="expression"><![CDATA[[A-Z]]]></param>
<message><![CDATA[ regexValidatorField must have all capilate A- Z characters ]]></message>
</field-validator>
</field>
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That regex is only for a single character.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic